From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
"David S . Miller" <davem@davemloft.net>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: bridge: Fix uninitialized error in br_fdb_sync_static()
Date: Thu, 1 Feb 2018 13:28:58 +0200 [thread overview]
Message-ID: <657a050a-444d-2ad3-17fb-e855f5c54ea9@cumulusnetworks.com> (raw)
In-Reply-To: <1517480728-5580-1-git-send-email-geert@linux-m68k.org>
On 01/02/18 12:25, Geert Uytterhoeven wrote:
> With gcc-4.1.2.:
>
> net/bridge/br_fdb.c: In function ‘br_fdb_sync_static’:
> net/bridge/br_fdb.c:996: warning: ‘err’ may be used uninitialized in this function
>
> Indeed, if the list is empty, err will be uninitialized, and will be
> propagated up as the function return value.
>
> Fix this by preinitializing err to zero.
>
> Fixes: eb7935830d00b9e0 ("net: bridge: use rhashtable for fdbs")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> net/bridge/br_fdb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index dc87fbc9a23b04e6..d9e69e4514beb20d 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -993,7 +993,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
> int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p)
> {
> struct net_bridge_fdb_entry *f, *tmp;
> - int err;
> + int err = 0;
>
> ASSERT_RTNL();
>
>
Thanks,
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
next prev parent reply other threads:[~2018-02-01 11:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 10:25 Geert Uytterhoeven
2018-02-01 11:28 ` Nikolay Aleksandrov [this message]
2018-02-01 14:48 ` David Miller
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=657a050a-444d-2ad3-17fb-e855f5c54ea9@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=arnd@arndb.de \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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
all inboxes | Powered by JetHome®