Skip to contentSkip to conversation

cmpci oops on rmmod + fix

PATCH In review Adrian Bunk 2 participants 2 messages Jul 17, 2004 – Jul 20, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmpci oops on rmmod + fix

Below is a patch originally sent against 2.6 by
Krzysztof Rusocki <[email protected]> (and already included in 2.6.8-rc1).

His explanation of the patch was:

<-- snip -->

The cmpci driver included in Linux 2.6.7 causes an oops on rmmod, I believe cm_remove should be marked __devexit rather than __devinit.

<-- snip -->

This is an obvious bug, and below is my backport of his fix to 2.4 . While I was editing struct cm_driver, I've also converted it to C99 initializers (as already done in 2.6).

drivers/sound/cmpci.c renamed from drivers/sound/cmpci.c.old +5 -5
@@ -3595,7 +3595,7 @@
 MODULE_DESCRIPTION("CM8x38 Audio Driver");
 MODULE_LICENSE("GPL");
 
-static void __devinit cm_remove(struct pci_dev *dev)
+static void __devexit cm_remove(struct pci_dev *dev)
 {
 	struct cm_state *s = pci_get_drvdata(dev);
 
@@ -3643,10 +3643,10 @@
 MODULE_DEVICE_TABLE(pci, id_table);
 
 static struct pci_driver cm_driver = {
-       name: "cmpci",
-       id_table: id_table,
-       probe: cm_probe,
-       remove: cm_remove
+	.name		= "cmpci",
+	.id_table	= id_table,
+	.probe		= cm_probe,
+	.remove		= __devexit_p(cm_remove)
 };
  
 static int __init init_cmpci(void)
#1 lore raw
Quoted 14 lines · Adrian Bunk

Below is a patch originally sent against 2.6 by
Krzysztof Rusocki <[email protected]> (and already included in 2.6.8-rc1).

His explanation of the patch was:

<-- snip -->

The cmpci driver included in Linux 2.6.7 causes an oops on rmmod, I believe cm_remove should be marked __devexit rather than __devinit.

<-- snip -->

Quoted 6 lines

This is an obvious bug, and below is my backport of his fix to 2.4 . While I was editing struct cm_driver, I've also converted it to C99 initializers (as already done in 2.6).

Looks good, applied.

Thanks Adrian.