From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, jiri@mellanox.com,
eladr@mellanox.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] bridge: mdb: avoid uninitialized variable warning
Date: Tue, 16 Feb 2016 15:37:58 -0500 (EST) [thread overview]
Message-ID: <20160216.153758.1508523820142527071.davem@davemloft.net> (raw)
In-Reply-To: <1455116946-2948649-1-git-send-email-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 10 Feb 2016 16:09:02 +0100
> 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")
Applied, thanks Arnd.
prev parent reply other threads:[~2016-02-16 20:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 15:09 [PATCH] bridge: mdb: avoid uninitialized variable warning Arnd Bergmann
2016-02-16 20:37 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160216.153758.1508523820142527071.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=arnd@arndb.de \
--cc=bridge@lists.linux-foundation.org \
--cc=eladr@mellanox.com \
--cc=jiri@mellanox.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).