From: John Johansen <john.johansen@canonical.com>
To: mateusznosek0@gmail.com, linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org
Cc: serge@hallyn.com, jmorris@namei.org
Subject: Re: [PATCH] security/apparmor/label.c: Clean code by removing redundant instructions
Date: Tue, 3 Mar 2020 10:40:44 -0800 [thread overview]
Message-ID: <e73b378a-acf0-0669-9e06-6633b5b25f86@canonical.com> (raw)
In-Reply-To: <20200303183023.32004-1-mateusznosek0@gmail.com>
On 3/3/20 10:30 AM, mateusznosek0@gmail.com wrote:
> From: Mateusz Nosek <mateusznosek0@gmail.com>
>
> 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>
Acked-by: John Johansen <john.johansen@canonical.com>
I will pull this into apparmor-next
> ---
> security/apparmor/label.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/security/apparmor/label.c b/security/apparmor/label.c
> index ba3987242282..676eebcbfd68 100644
> --- a/security/apparmor/label.c
> +++ b/security/apparmor/label.c
> @@ -311,8 +311,6 @@ int aa_vec_unique(struct aa_profile **vec, int n, int flags)
>
> 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;
> }
>
prev parent reply other threads:[~2020-03-03 18:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 18:30 [PATCH] security/apparmor/label.c: Clean code by removing redundant instructions mateusznosek0
2020-03-03 18:40 ` John Johansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e73b378a-acf0-0669-9e06-6633b5b25f86@canonical.com \
--to=john.johansen@canonical.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mateusznosek0@gmail.com \
--cc=serge@hallyn.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).