mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Satyam Sharma <satyam@infradead.org>
To: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Netdev Mailing List <netdev@vger.kernel.org>,
	Jeff Garzik <jeff@garzik.org>
Subject: [PATCH -mm 1/2] 3c59x: Fix uninitialized variable bug
Date: Tue, 4 Sep 2007 03:45:55 +0530 (IST)	[thread overview]
Message-ID: <alpine.LFD.0.999.0709040340250.8504@enigma.security.iitk.ac.in> (raw)


drivers/net/3c59x.c: In function 'vortex_up':
drivers/net/3c59x.c:1495: warning: 'err' may be used uninitialized in this function

is a genuine bug. The function returns an uninitialized value of 'err'
back to the caller, which expects it to be 0 for success cases. Let's
fix this by explicitly initializing 'err' to zero.

Signed-off-by: Satyam Sharma <satyam@infradead.org>

---

 drivers/net/3c59x.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.23-rc4-mm1/drivers/net/3c59x.c~fix	2007-09-04 03:29:40.000000000 +0530
+++ linux-2.6.23-rc4-mm1/drivers/net/3c59x.c	2007-09-04 03:30:08.000000000 +0530
@@ -1492,7 +1492,8 @@ vortex_up(struct net_device *dev)
 	struct vortex_private *vp = netdev_priv(dev);
 	void __iomem *ioaddr = vp->ioaddr;
 	unsigned int config;
-	int i, mii_reg1, mii_reg5, err;
+	int i, mii_reg1, mii_reg5;
+	int err = 0;
 
 	if (VORTEX_PCI(vp)) {
 		pci_set_power_state(VORTEX_PCI(vp), PCI_D0);	/* Go active */

             reply	other threads:[~2007-09-03 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.0.999.0709040340250.8504@enigma.security.iitk.ac.in >
2007-09-03 22:15 ` Satyam Sharma [this message]
2007-09-03 22:22   ` [PATCH -mm 2/2] 3c59x MAINTAINERS Satyam Sharma
2007-09-04  7:55     ` Steffen Klassert
2007-09-04  8:16   ` [PATCH -mm 1/2] 3c59x: Fix uninitialized variable bug Steffen Klassert
2007-09-04  8:39     ` Satyam Sharma
2007-09-04  8:53     ` Mark Hindley
2007-09-04  9:17       ` Steffen Klassert
2007-09-04  9:35       ` Mark Hindley
2007-09-04  9:39         ` Steffen Klassert
2007-09-06  9:55       ` Satyam Sharma
2007-09-06 21:40       ` Mark Hindley

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=alpine.LFD.0.999.0709040340250.8504@enigma.security.iitk.ac.in \
    --to=satyam@infradead.org \
    --cc=jeff@garzik.org \
    --cc=klassert@mathematik.tu-chemnitz.de \
    --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

all inboxes | Powered by JetHome®