From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758022Ab3AOS7b (ORCPT ); Tue, 15 Jan 2013 13:59:31 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:53400 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757810Ab3AOS72 (ORCPT ); Tue, 15 Jan 2013 13:59:28 -0500 From: Cong Ding To: Pablo Neira Ayuso , Patrick McHardy , "David S. Miller" , netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Cong Ding Subject: [PATCH] net: netfilter/xt_CT.c: fix uninitialized variable Date: Tue, 15 Jan 2013 19:58:34 +0100 Message-Id: <1358276314-9536-1-git-send-email-dinggnu@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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