Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3844878ybi; Tue, 18 Jun 2019 07:24:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9662uizFMIistayOY40X6scbAo7BiHX4U3+0NFtMyDxuqMz9xLdbX/X/apM30Dk1pfwfb X-Received: by 2002:a17:902:7083:: with SMTP id z3mr49476790plk.205.1560867840412; Tue, 18 Jun 2019 07:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560867840; cv=none; d=google.com; s=arc-20160816; b=VvhkKJA9duJn5s3fgWM7mOpCNT71gH3H+tNrVUmZptnq/LxgAF5CWbXyKbrThAnSuo x2kcvCyjS6mcgxfbk7b7Dd08hQFmMncwAhwxjbBE8VznrW8qnXNU+m4BImthvsa9bOuw fAYDhQyabNxXRiDHGYp6014qOFkg685xocfZ2DZbA4pBpSGP32of90T7lMIjM9ZS8s6o XBIvZlnkwmIyQaEw8LxMUYddsZluCiO+hbOA8ubcGwrsQYp7WvAcUVlz8n6sBzsnEsS7 /i4U8hrBtViDTgmrBWDe6CZ7hg0J0q3bzcWZigu+DEdKa5qaFyRYgcbrzyQqMA1UAQ04 ODKg== 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=FOuDtctTEeSCmjw51lNEIZI6qzWIax3sZ5CVYwbYAhk=; b=esNA67rMmrmyqSFP6QNyuKyLGGNtY4+N7AoPwCrhoGPbFScF2KVggr3z5SiyRmjBMy vbZ1J5TXLSLL887qA0Aw01NTfOMmtYjYzNauUTcvSAx+gqzEYQRmU1uX7qArwLjtDFRk FQMMHyrY9jrzd+gmK17a2VS9yPztROkAlTLHDP4jQBqeUN9emTPQhN77UB8lvJ0lhrQ3 oKGreVYY8UXzlS5vMwFW7DwJ1jNNmMESUXsPksLElv3mbLDbyTDqQF6GGfsjTQSJ0Rog 7bPDNkoEX9Bpwf9SxhvLKNcBDfGEcg1vtYl6L+Al+51p+rUuvlN2Csx0DQndpb6I7Wp0 dccA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si2307496pji.58.2019.06.18.07.23.43; Tue, 18 Jun 2019 07:24:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729381AbfFROWt (ORCPT + 99 others); Tue, 18 Jun 2019 10:22:49 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51156 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbfFROWt (ORCPT ); Tue, 18 Jun 2019 10:22:49 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hdF0W-0004yF-Dq; Tue, 18 Jun 2019 14:22:44 +0000 From: Colin King To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S . Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][V2][next] netfilter: synproxy: ensure zero is returned on non-error return path Date: Tue, 18 Jun 2019 15:22:44 +0100 Message-Id: <20190618142244.16463-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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: d7f9b2f18eae ("netfilter: synproxy: extract SYNPROXY infrastructure from {ipt, ip6t}_SYNPROXY") Signed-off-by: Colin Ian King --- 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..7bf5202e3222 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -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); @@ -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); -- 2.20.1