From: Akinobu Mita <akinobu.mita@gmail.com>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Subject: [PATCH] sky2: check pci_register_driver() error
Date: Sat, 15 Dec 2007 20:58:51 +0900 [thread overview]
Message-ID: <20071215115851.GA4816@APFDCB5C> (raw)
Check pci_register_driver() error and clean up debugfs entries
if error happened.
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/net/sky2.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: 2.6-git/drivers/net/sky2.c
===================================================================
--- 2.6-git.orig/drivers/net/sky2.c
+++ 2.6-git/drivers/net/sky2.c
@@ -4426,8 +4426,15 @@ static struct pci_driver sky2_driver = {
static int __init sky2_init_module(void)
{
+ int err;
+
sky2_debug_init();
- return pci_register_driver(&sky2_driver);
+ err = pci_register_driver(&sky2_driver);
+ if (err) {
+ sky2_debug_cleanup();
+ return err;
+ }
+ return 0;
}
static void __exit sky2_cleanup_module(void)
reply other threads:[~2007-12-15 11:59 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=20071215115851.GA4816@APFDCB5C \
--to=akinobu.mita@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).