2020-08-26 04:03:01

by Xu Wang

[permalink] [raw]
Subject: [PATCH] audit: Remove redundant null check

Because kfree_skb already checked NULL skb parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <[email protected]>
---
kernel/audit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 7efaece534a9..144e1e9322a5 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -934,8 +934,7 @@ static void audit_free_reply(struct audit_reply *reply)
if (!reply)
return;

- if (reply->skb)
- kfree_skb(reply->skb);
+ kfree_skb(reply->skb);
if (reply->net)
put_net(reply->net);
kfree(reply);
--
2.17.1


2020-08-26 13:34:05

by Paul Moore

[permalink] [raw]
Subject: Re: [PATCH] audit: Remove redundant null check

On Wed, Aug 26, 2020 at 12:00 AM Xu Wang <[email protected]> wrote:
>
> Because kfree_skb already checked NULL skb parameter,
> so the additional check is unnecessary, just remove it.
>
> Signed-off-by: Xu Wang <[email protected]>
> ---
> kernel/audit.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Merged into audit/next, thanks.

--
paul moore
http://www.paul-moore.com