From: David Miller <davem@davemloft.net>
To: akpm@linux-foundation.org
Cc: netdev@vger.kernel.org, fubar@us.ibm.com
Subject: Re: [patch 2/4] drivers/net/bonding/bond_sysfs.c: suppress uninitialized var warning
Date: Fri, 28 Mar 2008 16:16:07 -0700 (PDT) [thread overview]
Message-ID: <20080328.161607.259609373.davem@davemloft.net> (raw)
In-Reply-To: <200803282137.m2SLbUn3011629@imap1.linux-foundation.org>
From: akpm@linux-foundation.org
Date: Fri, 28 Mar 2008 14:37:30 -0700
> From: Andrew Morton <akpm@linux-foundation.org>
>
> drivers/net/bonding/bond_sysfs.c: In function `bonding_store_slaves':
> drivers/net/bonding/bond_sysfs.c:250: warning: 'original_mtu' might be used uninitialized in this function
>
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Barf!
I'll fix it like this:
commit 6952d8923bcc8d6b8b43b065cfe9a31bb24f0d58
Author: David S. Miller <davem@davemloft.net>
Date: Fri Mar 28 16:15:38 2008 -0700
[BOND]: Fix warning in bond_sysfs.c
original_mtu is only used if we end up with a non-NULL
dev, and it is assigned in all such cases, but GCC can't
see that.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 90a1f31..979c2d0 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -341,6 +341,7 @@ static ssize_t bonding_store_slaves(struct device *d,
if (command[0] == '-') {
dev = NULL;
+ original_mtu = 0;
bond_for_each_slave(bond, slave, i)
if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) {
dev = slave->dev;
prev parent reply other threads:[~2008-03-28 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:37 [patch 2/4] drivers/net/bonding/bond_sysfs.c: suppress uninitialized var warning akpm
2008-03-28 23:16 ` 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=20080328.161607.259609373.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=fubar@us.ibm.com \
--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).