[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>
This commit is contained in:
Takashi Iwai
2008-04-22 17:28:11 +02:00
parent 6b9a9b3296
commit ebf029da38
9 changed files with 26 additions and 32 deletions

View File

@ -1852,15 +1852,16 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id)
static int snd_echo_free(struct echoaudio *chip)
{
DE_INIT(("Stop DSP...\n"));
if (chip->comm_page) {
if (chip->comm_page)
rest_in_peace(chip);
snd_dma_free_pages(&chip->commpage_dma_buf);
}
DE_INIT(("Stopped.\n"));
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->comm_page)
snd_dma_free_pages(&chip->commpage_dma_buf);
if (chip->dsp_registers)
iounmap(chip->dsp_registers);