diff mbox series

[next] netfilter: synproxy: ensure zero is returned on non-error return path

Message ID 20190618141319.14961-1-colin.king@canonical.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series [next] netfilter: synproxy: ensure zero is returned on non-error return path | expand

Commit Message

Colin Ian King June 18, 2019, 2:13 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Currently function nf_synproxy_ipv6_init returns an uninitialized
garbage value in variable ret on a successful return.  Fix this by
returning zero on success.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/netfilter/nf_synproxy_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King June 18, 2019, 2:15 p.m. UTC | #1
On 18/06/2019 15:13, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently function nf_synproxy_ipv6_init returns an uninitialized
> garbage value in variable ret on a successful return.  Fix this by
> returning zero on success.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  net/netfilter/nf_synproxy_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
> index 50677285f82e..701f880d01e6 100644
> --- a/net/netfilter/nf_synproxy_core.c
> +++ b/net/netfilter/nf_synproxy_core.c
> @@ -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);
>  
> 
Scratch that, I've noticed the same issue in the ipv4 code too. I'll
send a V2.
diff mbox series

Patch

diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
index 50677285f82e..701f880d01e6 100644
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -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);