aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emu10k1x.c
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/emu10k1/emu10k1x.c
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/emu10k1/emu10k1x.c')
-rw-r--r--sound/pci/emu10k1/emu10k1x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 341f34e19f3..491a4a50f86 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -754,13 +754,13 @@ static int snd_emu10k1x_free(struct emu10k1x *chip)
754 // disable audio 754 // disable audio
755 outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG); 755 outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
756 756
757 // release the i/o port 757 /* release the irq */
758 release_and_free_resource(chip->res_port);
759
760 // release the irq
761 if (chip->irq >= 0) 758 if (chip->irq >= 0)
762 free_irq(chip->irq, chip); 759 free_irq(chip->irq, chip);
763 760
761 // release the i/o port
762 release_and_free_resource(chip->res_port);
763
764 // release the DMA 764 // release the DMA
765 if (chip->dma_buffer.area) { 765 if (chip->dma_buffer.area) {
766 snd_dma_free_pages(&chip->dma_buffer); 766 snd_dma_free_pages(&chip->dma_buffer);