Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755505AbXICWDD (ORCPT ); Mon, 3 Sep 2007 18:03:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752846AbXICWCw (ORCPT ); Mon, 3 Sep 2007 18:02:52 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:55690 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbXICWCv (ORCPT ); Mon, 3 Sep 2007 18:02:51 -0400 Date: Tue, 4 Sep 2007 03:45:55 +0530 (IST) From: Satyam Sharma X-X-Sender: satyam@enigma.security.iitk.ac.in To: Steffen Klassert cc: Linux Kernel Mailing List , Linux Netdev Mailing List , Jeff Garzik Subject: [PATCH -mm 1/2] 3c59x: Fix uninitialized variable bug Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 32 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 --- 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 */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/