Skip to content

Commit 0738534

Browse files
committed
netfilter: conntrack: clean up returns in nf_conntrack_log_invalid_sysctl()
JIRA: https://issues.redhat.com/browse/RHEL-115582 Upstream Status: commit f54186d commit f54186d Author: Dan Carpenter <dan.carpenter@linaro.org> Date: Mon Aug 4 13:35:15 2025 +0300 netfilter: conntrack: clean up returns in nf_conntrack_log_invalid_sysctl() Smatch complains that these look like error paths with missing error codes, especially the one where we return if nf_log_is_registered() is true: net/netfilter/nf_conntrack_standalone.c:575 nf_conntrack_log_invalid_sysctl() warn: missing error code? 'ret' In fact, all these return zero deliberately. Change them to return a literal instead which helps readability as well as silencing the warning. Fixes: e89a680 ("netfilter: load nf_log_syslog on enabling nf_conntrack_log_invalid") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Lance Yang <lance.yang@linux.dev> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent 1b4e27f commit 0738534

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/netfilter/nf_conntrack_standalone.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,16 @@ nf_conntrack_log_invalid_sysctl(const struct ctl_table *table, int write,
574574
return ret;
575575

576576
if (*(u8 *)table->data == 0)
577-
return ret;
577+
return 0;
578578

579579
/* Load nf_log_syslog only if no logger is currently registered */
580580
for (i = 0; i < NFPROTO_NUMPROTO; i++) {
581581
if (nf_log_is_registered(i))
582-
return ret;
582+
return 0;
583583
}
584584
request_module("%s", "nf_log_syslog");
585585

586-
return ret;
586+
return 0;
587587
}
588588

589589
static struct ctl_table_header *nf_ct_netfilter_header;

0 commit comments

Comments
 (0)