[PATCH] audit: remove unnecessary 'ret' initialization

Subsystems: security subsystem, the rest

STALE1919d

2 messages, 2 authors, 2021-06-11 · open the first message on its own page

[PATCH] audit: remove unnecessary 'ret' initialization

From: Austin Kim <hidden>
Date: 2021-06-11 02:29:52

From: Austin Kim <redacted>

The variable 'ret' is set to 0 when declared.
The 'ret' is unused until it is set to 0 again.

So it had better remove unnecessary initialization.

Signed-off-by: Austin Kim <redacted>
---
 security/lsm_audit.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 82ce14933513..5a5016ef43b0 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -119,7 +119,6 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb,
 		return -EINVAL;
 	ad->u.net->v6info.saddr = ip6->saddr;
 	ad->u.net->v6info.daddr = ip6->daddr;
-	ret = 0;
 	/* IPv6 can have several extension header before the Transport header
 	 * skip them */
 	offset = skb_network_offset(skb);
-- 
2.20.1

Re: [PATCH] audit: remove unnecessary 'ret' initialization

From: Paul Moore <paul@paul-moore.com>
Date: 2021-06-11 17:24:30

On Thu, Jun 10, 2021 at 10:30 PM Austin Kim [off-list ref] wrote:
From: Austin Kim <redacted>

The variable 'ret' is set to 0 when declared.
The 'ret' is unused until it is set to 0 again.

So it had better remove unnecessary initialization.

Signed-off-by: Austin Kim <redacted>
---
 security/lsm_audit.c | 1 -
 1 file changed, 1 deletion(-)
Merged into audit/next, thanks.

-- 
paul moore
www.paul-moore.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help