[2.4 patch] cmpci oops on rmmod + fix

From: Adrian Bunk (bunk_at_fs.tum.de)
Date: 07/17/04

  • Next message: bert hubert: "Re: audio cd writing causes massive swap and crash"
    Date:	Sat, 17 Jul 2004 22:07:04 +0200
    To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
    
    

    Below is a patch originally sent against 2.6 by
    Krzysztof Rusocki <kszysiu@iceberg.elsat.net.pl> (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).

    Signed-off-by: Adrian Bunk <bunk@fs.tum.de>

    --- linux-2.4.27-rc3-full/drivers/sound/cmpci.c.old 2004-07-17 21:56:28.000000000 +0200
    +++ linux-2.4.27-rc3-full/drivers/sound/cmpci.c 2004-07-17 21:57:22.000000000 +0200
    @@ -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)

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: bert hubert: "Re: audio cd writing causes massive swap and crash"

    Relevant Pages

    • [2.6 patch] remove ACPI S4bios support
      ... This patch was sent by Pavel Machek on: ... static struct pm_ops acpi_pm_ops; ... extern void do_suspend_lowlevel; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.12-rc1-mm1: resume regression [update] (was: Re:2.6.12-rc1-mm1: Kernel BUG at pci:389)
      ... :-) I'm not sure if the patch that I have reverted is related ... static struct sysdev_class irqrouter_sysdev_class = { ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [PATCH] Use read_timer_tsc only when CPU has TSC
      ... recent systems that has HPET also has CPUs that supports TSC. ... The patch is ... +static struct timer_opts timer_hpet; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [2.6 patch] security/seclvl.c: make some code static
      ... This patch makes some needlessly global code static. ... Callback function pointers for show and store ... +static struct seclvl_attribute sysfs_attr_seclvl = ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.4 patch] cmpci oops on rmmod + fix
      ... > Below is a patch originally sent against 2.6 by ... > The cmpci driver included in Linux 2.6.7 causes an oops on rmmod, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)