From: Mateusz Nosek Date: Tue, 3 Mar 2020 18:30:23 +0000 (+0100) Subject: security/apparmor/label.c: Clean code by removing redundant instructions X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c84b80cd41e05395655459ecc652fa5ee05c257e;p=linux.git 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 Signed-off-by: John Johansen --- diff --git a/security/apparmor/label.c b/security/apparmor/label.c index ba39872422826..676eebcbfd68e 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -311,8 +311,6 @@ out: static void label_destroy(struct aa_label *label) { - struct aa_label *tmp; - AA_BUG(!label); if (!label_isprofile(label)) { @@ -333,10 +331,6 @@ static void label_destroy(struct aa_label *label) aa_free_secid(label->secid); - tmp = rcu_dereference_protected(label->proxy->label, true); - if (tmp == label) - rcu_assign_pointer(label->proxy->label, NULL); - aa_put_proxy(label->proxy); label->proxy = (struct aa_proxy *) PROXY_POISON + 1; }