netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sky2: check pci_register_driver() error
@ 2007-12-15 11:58 Akinobu Mita
  0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2007-12-15 11:58 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-15 11:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-15 11:58 [PATCH] sky2: check pci_register_driver() error Akinobu Mita

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).