[PATCH] net: netfilter/xt_CT.c: fix uninitialized variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If CONFIG_NF_CONNTRACK_ZONES is not defined, the variable ret might be
uninitialized when it goes to err1 through line 125 and 263 respectively.
So I change these goto err1 to return -EINVAL directly.

Signed-off-by: Cong Ding <dinggnu@xxxxxxxxx>
---
 net/netfilter/xt_CT.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 2a08430..941f600 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -122,7 +122,7 @@ static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
 
 #ifndef CONFIG_NF_CONNTRACK_ZONES
 	if (info->zone)
-		goto err1;
+		return -EINVAL;
 #endif
 
 	ret = nf_ct_l3proto_try_module_get(par->family);
@@ -260,7 +260,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
 
 #ifndef CONFIG_NF_CONNTRACK_ZONES
 	if (info->zone)
-		goto err1;
+		return -EINVAL;
 #endif
 
 	ret = nf_ct_l3proto_try_module_get(par->family);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux