netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ron Mercer <ron.mercer@qlogic.com>
To: jeff@garzik.org
Cc: ron.mercer@qlogic.com, romieu@fr.zoreil.com,
	benjamin.li@qlogic.com, netdev@vger.kernel.org
Subject: [PATCH 01/13] qla3xxx: Return proper error codes when the 4022/4032 is being probed
Date: Mon, 26 Feb 2007 11:06:31 -0800	[thread overview]
Message-ID: <11725168032993-git-send-email-ron.mercer@qlogic.com> (raw)
In-Reply-To: <20070226190450.GA7325@linux-7mw0.qlogic.org>

From: Benjamin Li <benjamin.li@qlogic.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@qlogic.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.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


  reply	other threads:[~2007-02-26 19:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26 19:04 [PATCH 0/13] qla3xxx: bugfixes and cleanup after IBM/Redhat testing Ron Mercer
2007-02-26 19:06 ` Ron Mercer [this message]
2007-02-27  9:22   ` [PATCH 01/13] qla3xxx: Return proper error codes when the 4022/4032 is being probed Jeff Garzik
2007-03-01  0:48     ` [PATCH] qla3xxx: bugfix for line omitted in previous patch Ron Mercer
2007-03-03  1:17       ` Jeff Garzik
2007-02-26 19:06 ` [PATCH 02/13] qla3xxx: Remove unnecessary memset() in qla3xxx_send() Ron Mercer
2007-02-26 19:06 ` [PATCH 03/13] qla3xxx: Changed to use netdev_alloc_skb() from dev_alloc_skb Ron Mercer
2007-02-26 19:06 ` [PATCH 04/13] qla3xxx: Add ethtool functionality to report pause parameters Ron Mercer
2007-02-26 19:06 ` [PATCH 05/13] qla3xxx: Fix deadlock issue on error paths Ron Mercer
2007-02-26 19:06 ` [PATCH 06/13] qla3xxx: Remove API to change MTU Ron Mercer
2007-02-26 19:06 ` [PATCH 07/13] qla3xxx: Dynamically size the rx buffer queue based on the MTU Ron Mercer
2007-02-26 19:06 ` [PATCH 08/13] qla3xxx: Clean up receive process Ron Mercer
2007-02-26 19:06 ` [PATCH 09/13] qla3xxx: bugfix: Fixed jumbo frame handling for 3032 chip Ron Mercer
2007-02-26 19:06 ` [PATCH 10/13] qla3xxx: Check return code from pci_map_single() in ql_release_to_lrg_buf_free_list(), ql_populate_free_queue(), ql_alloc_large_buffers(), and ql3xxx_send() Ron Mercer
2007-02-26 19:06 ` [PATCH 11/13] qla3xxx: bugfix tx reset after stress conditions Ron Mercer
2007-02-26 19:06 ` [PATCH 12/13] qla3xxx: Kernic Panic on pSeries under " Ron Mercer
2007-02-26 19:06 ` [PATCH 13/13] qla3xxx: Bumping driver version number Ron Mercer

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=11725168032993-git-send-email-ron.mercer@qlogic.com \
    --to=ron.mercer@qlogic.com \
    --cc=benjamin.li@qlogic.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    /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).