Commit c84b80cd authored by Mateusz Nosek's avatar Mateusz Nosek Committed by John Johansen

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: default avatarMateusz Nosek <mateusznosek0@gmail.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent fe9fd23e
...@@ -311,8 +311,6 @@ int aa_vec_unique(struct aa_profile **vec, int n, int flags) ...@@ -311,8 +311,6 @@ int aa_vec_unique(struct aa_profile **vec, int n, int flags)
static void label_destroy(struct aa_label *label) static void label_destroy(struct aa_label *label)
{ {
struct aa_label *tmp;
AA_BUG(!label); AA_BUG(!label);
if (!label_isprofile(label)) { if (!label_isprofile(label)) {
...@@ -333,10 +331,6 @@ static void label_destroy(struct aa_label *label) ...@@ -333,10 +331,6 @@ static void label_destroy(struct aa_label *label)
aa_free_secid(label->secid); 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); aa_put_proxy(label->proxy);
label->proxy = (struct aa_proxy *) PROXY_POISON + 1; label->proxy = (struct aa_proxy *) PROXY_POISON + 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment