[OSS] Unregister driver if probing fails in SB
diff mbox series

Message ID 20031109041330.GA32452@gondor.apana.org.au
State New, archived
Headers show
Series
  • [OSS] Unregister driver if probing fails in SB
Related show

Commit Message

Herbert Xu Nov. 9, 2003, 4:13 a.m. UTC
Hi:

This patch adds a missing unregister when probing fails in the
OSS SoundBlaster driver.

Cheers,

Patch
diff mbox series

Index: kernel-source-2.5/sound/oss/sb_card.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/sound/oss/sb_card.c,v
retrieving revision 1.1.1.6
retrieving revision 1.3
diff -u -r1.1.1.6 -r1.3
--- kernel-source-2.5/sound/oss/sb_card.c	22 Aug 2003 23:57:18 -0000	1.1.1.6
+++ kernel-source-2.5/sound/oss/sb_card.c	9 Nov 2003 04:12:55 -0000	1.3
@@ -302,7 +302,13 @@ 
 
 	/* If either PnP or Legacy registered a card then return
 	 * success */
-	return (pres > 0 || lres > 0) ? 0 : -ENODEV;
+	if (pres <= 0 && lres <= 0) {
+#ifdef CONFIG_PNP
+		pnp_unregister_card_driver(&sb_pnp_driver);
+#endif
+		return -ENODEV;
+	}
+	return 0;
 }
 
 static void __exit sb_exit(void)