[PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

Subsystems: netfilter, networking [general], the rest

STALE1950d

3 messages, 3 authors, 2021-03-31 · open the first message on its own page

[PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

From: Colin King <hidden>
Date: 2021-03-31 14:27:00

From: Colin Ian King <redacted>

Currently the call to nf_log_register is returning an error code that
is not being assigned to ret and yet ret is being checked. Fix this by
adding in the missing assignment.

Addresses-Coverity: ("Logically dead code")
Fixes: 8d02e7da87a0 ("netfilter: nf_log_bridge: merge with nf_log_syslog")
Signed-off-by: Colin Ian King <redacted>
---
 net/netfilter/nf_log_syslog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c
index 025ab9c66d13..2518818ed479 100644
--- a/net/netfilter/nf_log_syslog.c
+++ b/net/netfilter/nf_log_syslog.c
@@ -1042,7 +1042,7 @@ static int __init nf_log_syslog_init(void)
 	if (ret < 0)
 		goto err4;
 
-	nf_log_register(NFPROTO_BRIDGE, &nf_bridge_logger);
+	ret = nf_log_register(NFPROTO_BRIDGE, &nf_bridge_logger);
 	if (ret < 0)
 		goto err5;
 
-- 
2.30.2

Re: [PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

From: Florian Westphal <fw@strlen.de>
Date: 2021-03-31 14:48:39

Colin King [off-list ref] wrote:
From: Colin Ian King <redacted>

Currently the call to nf_log_register is returning an error code that
is not being assigned to ret and yet ret is being checked. Fix this by
adding in the missing assignment.
Thanks for catching this.

Acked-by: Florian Westphal <fw@strlen.de>

Re: [PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2021-03-31 18:30:27

On Wed, Mar 31, 2021 at 03:26:06PM +0100, Colin King wrote:
From: Colin Ian King <redacted>

Currently the call to nf_log_register is returning an error code that
is not being assigned to ret and yet ret is being checked. Fix this by
adding in the missing assignment.
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help