summaryrefslogtreecommitdiff
path: root/sound/pci/cs46xx
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-01 14:47:29 +0200
committerJaroslav Kysela <perex@suse.cz>2006-06-22 21:34:08 +0200
commit0a50d2b2951cb7ae12726814f9a198e1c699aa0b (patch)
tree38197874a92ead9bf652732d2dc03ecafe3bfdaf /sound/pci/cs46xx
parentf079c25ab8a7d223875c5bac9b23b484e4a18f88 (diff)
[ALSA] Fix possible races in PCI driver removal
Call free_irq() before releasing others to avoid races when shared irq is issued. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs46xx')
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 69dbf542a6d..5c211443920 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2877,14 +2877,15 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
if (chip->region.idx[0].resource)
snd_cs46xx_hw_stop(chip);
+ if (chip->irq >= 0)
+ free_irq(chip->irq, chip);
+
for (idx = 0; idx < 5; idx++) {
struct snd_cs46xx_region *region = &chip->region.idx[idx];
if (region->remap_addr)
iounmap(region->remap_addr);
release_and_free_resource(region->resource);
}
- if (chip->irq >= 0)
- free_irq(chip->irq, chip);
if (chip->active_ctrl)
chip->active_ctrl(chip, -chip->amplifier);