[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>
Этот коммит содержится в:
Takashi Iwai
2008-04-22 17:28:11 +02:00
родитель 6b9a9b3296
Коммит ebf029da38
9 изменённых файлов: 26 добавлений и 32 удалений

Просмотреть файл

@@ -1439,7 +1439,7 @@ static int snd_nm256_free(struct nm256 *chip)
snd_nm256_capture_stop(chip);
if (chip->irq >= 0)
synchronize_irq(chip->irq);
free_irq(chip->irq, chip);
if (chip->cport)
iounmap(chip->cport);
@@ -1447,8 +1447,6 @@ static int snd_nm256_free(struct nm256 *chip)
iounmap(chip->buffer);
release_and_free_resource(chip->res_cport);
release_and_free_resource(chip->res_buffer);
if (chip->irq >= 0)
free_irq(chip->irq, chip);
pci_disable_device(chip->pci);
kfree(chip->ac97_regs);