From: Borislav Petkov <bbpetkov@yahoo.de>
To: linux-tr@linuxtr.net, netdev@vger.kernel.org
Cc: kernel-janitors@lists.osdl.org
Subject: [PATCH] Olympic (IBM PCI tokenring): handle return codes of register_netdev
Date: Fri, 20 Apr 2007 08:52:32 +0200 [thread overview]
Message-ID: <20070420065232.GA5165@zmei.tnic> (raw)
Handle return codes of register_netdev().
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Index: 21-rc7/drivers/net/tokenring/olympic.c
===================================================================
--- 21-rc7.orig/drivers/net/tokenring/olympic.c
+++ 21-rc7/drivers/net/tokenring/olympic.c
@@ -264,7 +264,10 @@ static int __devinit olympic_probe(struc
SET_NETDEV_DEV(dev, &pdev->dev);
pci_set_drvdata(pdev,dev) ;
- register_netdev(dev) ;
+
+ if (register_netdev(dev))
+ goto op_free_iomap;
+
printk("Olympic: %s registered as: %s\n",olympic_priv->olympic_card_name,dev->name);
if (olympic_priv->olympic_network_monitor) { /* Must go after register_netdev as we need the device name */
char proc_name[20] ;
@@ -281,7 +284,8 @@ op_free_iomap:
if (olympic_priv->olympic_lap)
iounmap(olympic_priv->olympic_lap);
- free_netdev(dev);
+ if (dev)
+ free_netdev(dev);
op_release_dev:
pci_release_regions(pdev);
reply other threads:[~2007-04-20 6:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070420065232.GA5165@zmei.tnic \
--to=bbpetkov@yahoo.de \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-tr@linuxtr.net \
--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