Skip to content

Commit f54186d

Browse files
Dan Carpenterummakynes
authored andcommitted
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>
1 parent c8a7c2c commit f54186d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

net/netfilter/nf_conntrack_standalone.c

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

569569
if (*(u8 *)table->data == 0)
570-
return ret;
570+
return 0;
571571

572572
/* Load nf_log_syslog only if no logger is currently registered */
573573
for (i = 0; i < NFPROTO_NUMPROTO; i++) {
574574
if (nf_log_is_registered(i))
575-
return ret;
575+
return 0;
576576
}
577577
request_module("%s", "nf_log_syslog");
578578

579-
return ret;
579+
return 0;
580580
}
581581

582582
static struct ctl_table_header *nf_ct_netfilter_header;

0 commit comments

Comments
 (0)