[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20071215115851.GA4816@APFDCB5C>
Date: Sat, 15 Dec 2007 20:58:51 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <shemminger@...ux-foundation.org>
Subject: [PATCH] sky2: check pci_register_driver() error
Check pci_register_driver() error and clean up debugfs entries
if error happened.
Cc: Stephen Hemminger <shemminger@...ux-foundation.org>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.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)
--
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