Skip to content

Commit 6fc09f1

Browse files
JuliaLawallummakynes
authored andcommitted
netfilter: nfnetlink_log: fix error return code in init path
Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent ef6acf6 commit 6fc09f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/netfilter/nfnetlink_log.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,10 @@ static int __init nfnetlink_log_init(void)
996996

997997
#ifdef CONFIG_PROC_FS
998998
if (!proc_create("nfnetlink_log", 0440,
999-
proc_net_netfilter, &nful_file_ops))
999+
proc_net_netfilter, &nful_file_ops)) {
1000+
status = -ENOMEM;
10001001
goto cleanup_logger;
1002+
}
10011003
#endif
10021004
return status;
10031005

0 commit comments

Comments
 (0)