diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-04-22 11:28:11 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:41 -0400 |
commit | ebf029da38829ede6b53ac8a5ad45b149064ea16 (patch) | |
tree | aebf6bddd245a874577fc321978b3f7137e8ac39 /sound/pci/cs46xx | |
parent | 6b9a9b329640b7e8143df7b2782884ea758650f7 (diff) |
[ALSA] Fix possible races at free_irq in PCI drivers
The irq handler of PCI drivers must be released before releasing other
resources since the handler for a shared irq can be still called and
may access the freed resource again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs46xx')
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 87ddffcd9d89..e214e567dec8 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -2772,6 +2772,9 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip) | |||
2772 | if (chip->irq >= 0) | 2772 | if (chip->irq >= 0) |
2773 | free_irq(chip->irq, chip); | 2773 | free_irq(chip->irq, chip); |
2774 | 2774 | ||
2775 | if (chip->active_ctrl) | ||
2776 | chip->active_ctrl(chip, -chip->amplifier); | ||
2777 | |||
2775 | for (idx = 0; idx < 5; idx++) { | 2778 | for (idx = 0; idx < 5; idx++) { |
2776 | struct snd_cs46xx_region *region = &chip->region.idx[idx]; | 2779 | struct snd_cs46xx_region *region = &chip->region.idx[idx]; |
2777 | if (region->remap_addr) | 2780 | if (region->remap_addr) |
@@ -2779,9 +2782,6 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip) | |||
2779 | release_and_free_resource(region->resource); | 2782 | release_and_free_resource(region->resource); |
2780 | } | 2783 | } |
2781 | 2784 | ||
2782 | if (chip->active_ctrl) | ||
2783 | chip->active_ctrl(chip, -chip->amplifier); | ||
2784 | |||
2785 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | 2785 | #ifdef CONFIG_SND_CS46XX_NEW_DSP |
2786 | if (chip->dsp_spos_instance) { | 2786 | if (chip->dsp_spos_instance) { |
2787 | cs46xx_dsp_spos_destroy(chip); | 2787 | cs46xx_dsp_spos_destroy(chip); |