2.6.0-test* - oopses in some OSS drivers
PATCH 1/1 2.6.0-test* - oopses in some OSS drivers
Hello,
some time ago I reported Oops which I got on "rmmod es1371"
(http://www.ussg.iu.edu/hypermail/linux/kernel/0310.2/0656.html).
It was caused by __devinit used for *_remove() function (it affects configurations with CONFIG_MODULES=y and CONFIG_HOTPLUG not set). I found the same issue in more OSS drivers sources - and it's still present in -test11.
Here is patch for this issue - details inside. Tested on es1371 module - rmmod doesn't cause Oops any longer.
Signature · 2 lines
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/ PLD Linux http://www.pld-linux.org/
Fix for oops on rmmod caused by *_remove() function marked as __devinit (and thus discarded after module initialization - if CONFIG_MODULES=y and CONFIG_HOTPLUG is not set).
This patch changes __devinit to __devexit and adds __devexit_p() where pointer to such function is used.
The only exception is au1000, where au1000_remove() is called from cleanup_au1000() function - __devinit is jest removed there.
-- Jakub Bogusz <[email protected]>
sound/oss/cs4281/cs4281m.c renamed from sound/oss/cs4281/cs4281m.c.orig +2 -2
@@ -4435,7 +4435,7 @@// --------------------------------------------------------------------- -static void __devinit cs4281_remove (struct pci_dev *pci_dev) +static void __devexit cs4281_remove(struct pci_dev *pci_dev) {struct cs4281_state *s =pci_get_drvdata (pci_dev);// stop DMA controller
@@ -4469,7 +4469,7 @@ .name = "cs4281", .id_table = cs4281_pci_tbl, .probe = cs4281_probe, - .remove = cs4281_remove, + .remove = __devexit_p(cs4281_remove), .suspend = CS4281_SUSPEND_TBL, .resume = CS4281_RESUME_TBL, };
sound/oss/cs46xx.c renamed from sound/oss/cs46xx.c.orig +2 -2
@@ -5603,7 +5603,7 @@// --------------------------------------------------------------------- -static void __devinit cs46xx_remove (struct pci_dev *pci_dev) +static void __devexit cs46xx_remove(struct pci_dev *pci_dev) {struct cs_card *card =PCI_GET_DRIVER_DATA (pci_dev);int i;
@@ -5730,7 +5730,7 @@ .name = "cs46xx", .id_table = cs46xx_pci_tbl, .probe = cs46xx_probe, - .remove = cs46xx_remove, + .remove = __devexit_p(cs46xx_remove), .suspend = CS46XX_SUSPEND_TBL, .resume = CS46XX_RESUME_TBL, };
sound/oss/esssolo1.c renamed from sound/oss/esssolo1.c.orig +2 -2
@@ -2407,7 +2407,7 @@return ret; } -static void __devinit solo1_remove (struct pci_dev *dev) +static void __devexit solo1_remove(struct pci_dev *dev) {struct solo1_state *s =pci_get_drvdata (dev);
@@ -2447,7 +2447,7 @@ .name = "ESS Solo1", .id_table = id_table, .probe = solo1_probe, - .remove = solo1_remove, + .remove = __devexit_p(solo1_remove), .suspend = solo1_suspend, .resume = solo1_resume, };
sound/oss/ite8172.c renamed from sound/oss/ite8172.c.orig +2 -2
@@ -2165,7 +2165,7 @@return -1 ; } -static void __devinit it8172_remove (struct pci_dev *dev) +static void __devexit it8172_remove(struct pci_dev *dev) {struct it8172_state *s =pci_get_drvdata (dev);
@@ -2200,7 +2200,7 @@ .name = IT8172_MODULE_NAME, .id_table = id_table, .probe = it8172_probe, - .remove = it8172_remove + .remove = __devexit_p(it8172_remove) };static int __init init_it8172 (void )
sound/oss/rme96xx.c renamed from sound/oss/rme96xx.c.orig +2 -2
@@ -1033,7 +1033,7 @@ } -static void __devinit rme96xx_remove (struct pci_dev *dev) +static void __devexit rme96xx_remove(struct pci_dev *dev) {int i;rme96xx_info *s =pci_get_drvdata (dev);
@@ -1087,7 +1087,7 @@ .name = "rme96xx", .id_table = id_table, .probe = rme96xx_probe, - .remove = rme96xx_remove, + .remove = __devexit_p(rme96xx_remove), };static int __init init_rme96xx (void )
sound/oss/au1000.c renamed from sound/oss/au1000.c.orig +1 -1
@@ -2177,7 +2177,7 @@return -1 ; } -static void __devinit au1000_remove (void ) +static void au1000_remove (void ) {struct au1000_state *s = &au1000_state;
sound/oss/sonicvibes.c renamed from sound/oss/sonicvibes.c.orig +2 -2
@@ -2678,7 +2678,7 @@return ret; } -static void __devinit sv_remove (struct pci_dev *dev) +static void __devexit sv_remove(struct pci_dev *dev) {struct sv_state *s =pci_get_drvdata (dev);
@@ -2720,7 +2720,7 @@ .name = "sonicvibes", .id_table = id_table, .probe = sv_probe, - .remove = sv_remove, + .remove = __devexit_p(sv_remove), };static int __init init_sonicvibes (void )
sound/oss/nec_vrc5477.c renamed from sound/oss/nec_vrc5477.c.orig +2 -2
@@ -1964,7 +1964,7 @@return -1 ; } -static void __devinit vrc5477_ac97_remove (struct pci_dev *dev) +static void __devexit vrc5477_ac97_remove(struct pci_dev *dev) {struct vrc5477_ac97_state *s =pci_get_drvdata (dev);
@@ -2000,7 +2000,7 @@ .name = VRC5477_AC97_MODULE_NAME, .id_table = id_table, .probe = vrc5477_ac97_probe, - .remove = vrc5477_ac97_remove, + .remove = __devexit_p(vrc5477_ac97_remove), };static int __init init_vrc5477_ac97 (void )
sound/oss/es1371.c renamed from sound/oss/es1371.c.orig +2 -2
@@ -3001,7 +3001,7 @@return res; } -static void __devinit es1371_remove (struct pci_dev *dev) +static void __devexit es1371_remove(struct pci_dev *dev) {struct es1371_state *s =pci_get_drvdata (dev);
@@ -3043,7 +3043,7 @@ .name = "es1371", .id_table = id_table, .probe = es1371_probe, - .remove = es1371_remove, + .remove = __devexit_p(es1371_remove), };static int __init init_es1371 (void )
sound/oss/es1370.c renamed from sound/oss/es1370.c.orig +2 -2
@@ -2700,7 +2700,7 @@return ret; } -static void __devinit es1370_remove (struct pci_dev *dev) +static void __devexit es1370_remove(struct pci_dev *dev) {struct es1370_state *s =pci_get_drvdata (dev);
@@ -2736,7 +2736,7 @@ .name = "es1370", .id_table = id_table, .probe = es1370_probe, - .remove = es1370_remove, + .remove = __devexit_p(es1370_remove), };static int __init init_es1370 (void )