From: John Johansen <john.johansen@canonical.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>
Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] apparmor: Remove unnecessary NULL check before kvfree()
Date: Thu, 7 Nov 2024 09:09:54 -0800 [thread overview]
Message-ID: <75ea2e8a-fc2e-487a-8f20-c0664b1eaf05@canonical.com> (raw)
In-Reply-To: <20241107112526.2312-2-thorsten.blum@linux.dev>
On 11/7/24 03:25, Thorsten Blum wrote:
> Since kvfree() already checks if its argument is NULL, an additional
> check before calling kvfree() is unnecessary and can be removed.
>
> Remove it and the following Coccinelle/coccicheck warning reported by
> ifnullfree.cocci:
>
> WARNING: NULL check before some freeing functions is not needed
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
sorry I am way way behind on this. I am going to work through the backlog
on this list today.
Acked-by: John Johansen <john.johansen@canonical.com>
I have pulled this in to my local tree, and will push it up in a few
hours once I been through the other patches and testing.
> ---
> security/apparmor/policy.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
> index 14df15e35695..ce1c96cb2aed 100644
> --- a/security/apparmor/policy.c
> +++ b/security/apparmor/policy.c
> @@ -103,8 +103,7 @@ static void aa_free_pdb(struct aa_policydb *pdb)
> {
> if (pdb) {
> aa_put_dfa(pdb->dfa);
> - if (pdb->perms)
> - kvfree(pdb->perms);
> + kvfree(pdb->perms);
> aa_free_str_table(&pdb->trans);
> kfree(pdb);
> }
next prev parent reply other threads:[~2024-11-07 17:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 11:25 Thorsten Blum
2024-11-07 17:09 ` John Johansen [this message]
2024-11-07 17:24 ` Thorsten Blum
-- strict thread matches above, loose matches on Subject: below --
2024-10-18 21:45 Thorsten Blum
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=75ea2e8a-fc2e-487a-8f20-c0664b1eaf05@canonical.com \
--to=john.johansen@canonical.com \
--cc=apparmor@lists.ubuntu.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=thorsten.blum@linux.dev \
/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
all inboxes | Powered by JetHome®