[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11725168032993-git-send-email-ron.mercer@qlogic.com>
Date: Mon, 26 Feb 2007 11:06:31 -0800
From: Ron Mercer <ron.mercer@...gic.com>
To: jeff@...zik.org
Cc: ron.mercer@...gic.com, romieu@...zoreil.com,
benjamin.li@...gic.com, netdev@...r.kernel.org
Subject: [PATCH 01/13] qla3xxx: Return proper error codes when the 4022/4032 is being probed
From: Benjamin Li <benjamin.li@...gic.com>
The return code was not properly set when when allocating memory or mapping
memory failed. Depending on the stack, the return code would sometimes
return 0, which indicates everything was ok, when in fact there was an error.
This would cause trouble when the module was removed. Now, we will pass
back the proper return code when an error occurs during the PCI probe.
Signed-off-by: Benjamin Li <benjamin.li@...gic.com>
Signed-off-by: Ron Mercer <ron.mercer@...gic.com>
---
drivers/net/qla3xxx.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 2429b27..d1c90ca 100755
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3609,8 +3609,12 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
}
ndev = alloc_etherdev(sizeof(struct ql3_adapter));
- if (!ndev)
+ if (!ndev) {
+ printk(KERN_ERR PFX "%s could not alloc etherdev\n",
+ pci_name(pdev));
+ err = -ENOMEM;
goto err_out_free_regions;
+ }
SET_MODULE_OWNER(ndev);
SET_NETDEV_DEV(ndev, &pdev->dev);
@@ -3639,6 +3643,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
if (!qdev->mem_map_registers) {
printk(KERN_ERR PFX "%s: cannot map device registers\n",
pci_name(pdev));
+ err = -EIO;
goto err_out_free_ndev;
}
@@ -3667,6 +3672,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
printk(KERN_ALERT PFX
"ql3xxx_probe: Adapter #%d, Invalid NVRAM parameters.\n",
qdev->index);
+ err = -EIO;
goto err_out_iounmap;
}
--
1.5.0.rc4.16.g9e258
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists