aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/nm256
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-04-22 11:28:11 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:41 -0400
commitebf029da38829ede6b53ac8a5ad45b149064ea16 (patch)
treeaebf6bddd245a874577fc321978b3f7137e8ac39 /sound/pci/nm256
parent6b9a9b329640b7e8143df7b2782884ea758650f7 (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/nm256')
-rw-r--r--sound/pci/nm256/nm256.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 7ac654e381da..7efb838d18a6 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1439,7 +1439,7 @@ static int snd_nm256_free(struct nm256 *chip)
1439 snd_nm256_capture_stop(chip); 1439 snd_nm256_capture_stop(chip);
1440 1440
1441 if (chip->irq >= 0) 1441 if (chip->irq >= 0)
1442 synchronize_irq(chip->irq); 1442 free_irq(chip->irq, chip);
1443 1443
1444 if (chip->cport) 1444 if (chip->cport)
1445 iounmap(chip->cport); 1445 iounmap(chip->cport);
@@ -1447,8 +1447,6 @@ static int snd_nm256_free(struct nm256 *chip)
1447 iounmap(chip->buffer); 1447 iounmap(chip->buffer);
1448 release_and_free_resource(chip->res_cport); 1448 release_and_free_resource(chip->res_cport);
1449 release_and_free_resource(chip->res_buffer); 1449 release_and_free_resource(chip->res_buffer);
1450 if (chip->irq >= 0)
1451 free_irq(chip->irq, chip);
1452 1450
1453 pci_disable_device(chip->pci); 1451 pci_disable_device(chip->pci);
1454 kfree(chip->ac97_regs); 1452 kfree(chip->ac97_regs);