Skip to content

Commit

Permalink
netfilter: synproxy: ensure zero is returned on non-error return path
Browse files Browse the repository at this point in the history
Currently functions nf_synproxy_{ipc4|ipv6}_init return an uninitialized
garbage value in variable ret on a successful return.  Fix this by
returning zero on success.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d7f9b2f ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Colin Ian King authored and Pablo Neira Ayuso committed Jun 19, 2019
1 parent d7f9b2f commit 72c5e11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netfilter/nf_synproxy_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net)
}

snet->hook_ref4++;
return err;
return 0;
}
EXPORT_SYMBOL_GPL(nf_synproxy_ipv4_init);

Expand Down Expand Up @@ -1223,7 +1223,7 @@ nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net)
}

snet->hook_ref6++;
return err;
return 0;
}
EXPORT_SYMBOL_GPL(nf_synproxy_ipv6_init);

Expand Down

0 comments on commit 72c5e11

Please sign in to comment.