Message ID | 1455116946-2948649-1-git-send-email-arnd@arndb.de |
---|---|
State | Accepted |
Commit | 56bb7fd994f4cc163de08006bf68d959027a9f36 |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2704070lbl; Wed, 10 Feb 2016 07:18:31 -0800 (PST) X-Received: by 10.98.33.131 with SMTP id o3mr59275531pfj.97.1455117052659; Wed, 10 Feb 2016 07:10:52 -0800 (PST) Return-Path: <linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org> Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fd8si5558216pab.235.2016.02.10.07.10.52 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2016 07:10:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTWOq-00075v-9t; Wed, 10 Feb 2016 15:09:48 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTWOn-000703-3s for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2016 15:09:46 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LlFeI-1Zv0qn2Ws2-00b0Oe; Wed, 10 Feb 2016 16:09:11 +0100 From: Arnd Bergmann <arnd@arndb.de> To: Stephen Hemminger <stephen@networkplumber.org>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH] bridge: mdb: avoid uninitialized variable warning Date: Wed, 10 Feb 2016 16:09:02 +0100 Message-Id: <1455116946-2948649-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:BSja7LzJXWvkbRg0Y2WuNCQy3FNc0DVMVW/PI6z6yauiaRrGqBq NqaCOyBS5SMs2ovQjuEuKufBYhc6Jlp7IAI092MFlDFNK0cdHrgYxSH9FxuthwoKyfCno77 ISkwiy51t3yq2t8hj9QghJ4uz+xcefcdfoFIJW65wQf5Zl37KsloyrxD5AOEVGZomewNcNv xroE8bVeqLA4jXoo/RWsw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Im0Ml+lyb0U=:DuACzv6jL5K2Vz0qGaE2wS id6BdtUxbj3mYaCZjGDcPOiiAb4c79js6TbndYlKNV+hjvfqs55TkUlvr66HVoS07KvwzETMQ 72fZZo04nqOH4SBzICW9XNFbztfhUQqrqf/HalcqGxraxApRqp2SbRlOqtDr8xwJ87nEANOFf brgMt2gccD6mi8kAGO4pSC1FSYVM3GCcThqweeW+Ystt52gvHa1nhSmAhM+3OHui0ZwzVXChW sjebUXOZkFb14n7C1EhtCk2+Gy2n4Z4npFaC0HqAaZqw4HqBPdz2fyy9BY8iDeBdXWA8UD528 7sj1Fo+lElCYA++U0B3dUrCEq+tR7Ll5nALpuM3ZDgBKMOFvPBG2sCjAf17XeMZb6SLwqrIN2 aPTlDNDnvkW2i46E4uaQNd3nkGgfRITXfv+0iMsyKADnlOCSsvknQ3LD3Gb/2Z7jGa1jShd90 DiPLFitCVvdhwq9NImRjtlegHwB7lDkA4ldAVunLJ3lKsi4xcBAaJY7zp2n5XroFGeJ4vrOpU ljgKnGLkEJAsAay8tcLQOLAFBQUny6VoeT/xNSgGdzWFWsDACcF21n1dDTOfymMrcMLTHmWMR 4hrm9jBWDVDIA8qTAKr/ItcAyxMqVEcDv5xB/KiGKHLasYuD6qS9AQMVajGjEhF/ZacB9r3j6 whYZUPWrAHjjA9QU8MEHuDc9FHLd9xz4CSj1XVw3ej8TmKfioIPfhpBcwR4ldqu9NBOs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160210_070945_640152_FE7256C9 X-CRM114-Status: GOOD ( 13.38 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.10 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.227.17.10 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Arnd Bergmann <arnd@arndb.de>, netdev@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jiri Pirko <jiri@mellanox.com>, Elad Raz <eladr@mellanox.com>, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org |
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index ac089286526e..9ab1fcd488c6 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -437,8 +437,8 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, mp = br_mdb_ip_get(mdb, group); if (!mp) { mp = br_multicast_new_group(br, port, group); - err = PTR_ERR(mp); - if (IS_ERR(mp)) + err = PTR_ERR_OR_ZERO(mp); + if (err) return err; }
A recent change to the mdb code confused the compiler to the point where it did not realize that the port-group returned from br_mdb_add_group() is always valid when the function returns a nonzero return value, so we get a spurious warning: net/bridge/br_mdb.c: In function 'br_mdb_add': net/bridge/br_mdb.c:542:4: error: 'pg' may be used uninitialized in this function [-Werror=maybe-uninitialized] __br_mdb_notify(dev, entry, RTM_NEWMDB, pg); Slightly rearranging the code in br_mdb_add_group() makes the problem go away, as gcc is clever enough to see that both functions check for 'ret != 0'. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 9e8430f8d60d ("bridge: mdb: Passing the port-group pointer to br_mdb module") --- net/bridge/br_mdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel