Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

security/apparmor/label.c: Clean code by removing redundant instructions

Previously 'label->proxy->label' value checking
and conditional reassigning were done twice in the same function.
The second one is redundant and can be removed.

Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Mateusz Nosek and committed by
John Johansen
c84b80cd fe9fd23e

-6
-6
security/apparmor/label.c
··· 311 311 312 312 static void label_destroy(struct aa_label *label) 313 313 { 314 - struct aa_label *tmp; 315 - 316 314 AA_BUG(!label); 317 315 318 316 if (!label_isprofile(label)) { ··· 330 332 rcu_assign_pointer(label->proxy->label, NULL); 331 333 332 334 aa_free_secid(label->secid); 333 - 334 - tmp = rcu_dereference_protected(label->proxy->label, true); 335 - if (tmp == label) 336 - rcu_assign_pointer(label->proxy->label, NULL); 337 335 338 336 aa_put_proxy(label->proxy); 339 337 label->proxy = (struct aa_proxy *) PROXY_POISON + 1;