Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp661924ybi; Wed, 19 Jun 2019 05:55:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW38n3RbQMoBSC2vTcsWQfJtDfFw3ma3dTW00UsIXORhH1hmR2e/CON4ZUwyRDjZDzdBVw X-Received: by 2002:a62:68c4:: with SMTP id d187mr129123019pfc.245.1560948923329; Wed, 19 Jun 2019 05:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560948923; cv=none; d=google.com; s=arc-20160816; b=BZEtX2lOhqgLPHFpoIn1hl3KuGQTrMdRL4mbA+HJSJY0UsyFCiDZEHd0eaI97yRFEQ F7j2lt8d4LAwJK/BFt5rz2Nv2ZQD4C63RFZBtCI26hsGKYFPfwXRy7EzIzhSoPW+hnqv QbV/Hrki5gd4ioa6wT6firluzOQri8IPW/cbcyBU4A0FOZnWLcHrT8sdAEMQjiLICsBI r4aIqDXu07god/6Xm1pQiBK1phV04hlhQsdVzRtbQ/d9lAxddt/3BzsJBDyBr/B7HvFN YKIDuJUJlxFKUhiDMUNeLIK/46LdJTczvnBQr0SedgRLeT/UeRB5ZW1sqf3qLiuqXIUb Zecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vvrpsyCSpEiNx8xg/3Xg4YAvmT2MVBRbhdWaqIrKXuI=; b=orexTCoFc2W5kQX+CCu4yLIHNu9QELHg3ebvf8XISIzQwGFQWQ+KkH0rhPF/+xBo5t vyubsJ8St8mzoPDTwJs4AdmOi++8bg3oq9vHSbUNZVapHoSoPi/4/73mEIOqDF2pC42J yBI4zy0uBShw9ziINYh2Iftz/nD01rtQlsS15f18tuXpy/Kfxbzm11e2A6nna3EhX+kq fVfJ7hbRXwH2E6jJpU8t1IKlR9XtM0Abgdh9J22zoUy4qnj7dNAwSu9hTDw9S0Pnbr42 HrhxP5fSTUsv+7hukUbFHxJHfZP54Gly8r7n0A84Py6FayAxsKFzTRB5lTcRuPIb0o6P /vOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si3009280pgb.292.2019.06.19.05.55.07; Wed, 19 Jun 2019 05:55:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731869AbfFSMxc (ORCPT + 99 others); Wed, 19 Jun 2019 08:53:32 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:52193 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731576AbfFSMxc (ORCPT ); Wed, 19 Jun 2019 08:53:32 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MKKpV-1httFS3L4R-00LmVZ; Wed, 19 Jun 2019 14:53:17 +0200 From: Arnd Bergmann To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" Cc: Arnd Bergmann , Fernando Fernandez Mancera , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfilter: synproxy: fix nf_synproxy_ipv{4,6}_init() return code Date: Wed, 19 Jun 2019 14:53:07 +0200 Message-Id: <20190619125314.1005993-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:sHRKPJxI1zML8tYdc1cfhcMo3aUXVxAOGIhwNfIQjjwRunCOAsx NHm/ktqi20sgAtTRnoNS3E45QBQpIjaZVx0+5T9JDOd12yuSjTMfuKf3I2WxHLaP7fgMW6m OwZXXHliGncpKNm0YIe9lofpzzzFwQEKcW4afzoDhJsMbevSna3JBee75coK4Xtf9M6zYDI ksMK9hUacXQ2WZJ8dL5kw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:SCWUrpyWP2Q=:ut0cProTqarHG0QCVTfh9D MjpFumB3sMKmB4UQDW90OwoYEvXD6fN2P5u7C9ipmz67bnCj2+fgixTlHZWi50c5YEvc+Ar0s 8ss2WW2QFYbWSNP3i72/7XdPkBZGA4mprtHQO4vNyu0B5D1bLM+NUG8E2vzfgaBZxN/Aa0oNd 4JAmSW2hwHbQanQfSE0rZv990u2wg4KrBD/3M+bpjhkORv74ThiMRcHAWYB2L/VsCykY46tc8 Zd5FJH/nERhpZZnfoTb74nmUKip5BRjbqoZwsColXihClt81pbpfyG2jB1Wi+sVI1w7b51JKb tpKvqT5+L1JlVoCBMtsmPp+RJu5SDDxgW6lBl4e+iesBvqIdQYtqkMTLgREf575P2cTLZewQ2 QFCXR+ikN+dfMGC9EWSwj266DhSLi09CMgXLyOgB51LsCpBoDGP6qvf3teeRebZydq6Ae0V26 zqmoMIBUch19Sy+HzSrh8dQDx+4T2X17Hky8gaAP1tYnhsCBzMLr+4+MX4P+YzxpNcXKFDIWB pnCqDkDwWHX2ydF47Bw/dsS2NsggITOpih1wQXbijgiINj2u1n6xV/kBFRFhqk844L7d0CEL5 JQA+koiuVWPxlhVuCcjFXIpdUxzZzYA3vRY1xYK22sEaeS7MX4JORqyTpM3UkbZno0sYQtjZR Fy1kLg9kgrx1ImoDpIc+WgpKE7sy+xLDdc0v2h+sfb60PtXAdFKYePZHNTIe2j3XO3WctYQ4l nny3uTmIzSdnSB1+favdUtgwez9Lxjyv7snIvA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We return an uninitialized variable on success: net/netfilter/nf_synproxy_core.c:793:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (snet->hook_ref4 == 0) { ^~~~~~~~~~~~~~~~~~~~ Initialize the return code to zero first. Fixes: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY") Signed-off-by: Arnd Bergmann --- net/netfilter/nf_synproxy_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c index 50677285f82e..283686e972a0 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -788,7 +788,7 @@ static const struct nf_hook_ops ipv4_synproxy_ops[] = { int nf_synproxy_ipv4_init(struct synproxy_net *snet, struct net *net) { - int err; + int err = 0; if (snet->hook_ref4 == 0) { err = nf_register_net_hooks(net, ipv4_synproxy_ops, @@ -1213,7 +1213,7 @@ static const struct nf_hook_ops ipv6_synproxy_ops[] = { int nf_synproxy_ipv6_init(struct synproxy_net *snet, struct net *net) { - int err; + int err = 0; if (snet->hook_ref6 == 0) { err = nf_register_net_hooks(net, ipv6_synproxy_ops, -- 2.20.0