aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/echoaudio.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/echoaudio/echoaudio.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/echoaudio/echoaudio.c')
-rw-r--r--sound/pci/echoaudio/echoaudio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 90ec090792ba..e16dc92e82fb 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1852,15 +1852,16 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id)
1852static int snd_echo_free(struct echoaudio *chip) 1852static int snd_echo_free(struct echoaudio *chip)
1853{ 1853{
1854 DE_INIT(("Stop DSP...\n")); 1854 DE_INIT(("Stop DSP...\n"));
1855 if (chip->comm_page) { 1855 if (chip->comm_page)
1856 rest_in_peace(chip); 1856 rest_in_peace(chip);
1857 snd_dma_free_pages(&chip->commpage_dma_buf);
1858 }
1859 DE_INIT(("Stopped.\n")); 1857 DE_INIT(("Stopped.\n"));
1860 1858
1861 if (chip->irq >= 0) 1859 if (chip->irq >= 0)
1862 free_irq(chip->irq, chip); 1860 free_irq(chip->irq, chip);
1863 1861
1862 if (chip->comm_page)
1863 snd_dma_free_pages(&chip->commpage_dma_buf);
1864
1864 if (chip->dsp_registers) 1865 if (chip->dsp_registers)
1865 iounmap(chip->dsp_registers); 1866 iounmap(chip->dsp_registers);
1866 1867