ALSA: hda-intel - Fix race in remove
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Sep 2006 19:39:12 +0000 (21:39 +0200)
committerAdrian Bunk <bunk@stusta.de>
Tue, 5 Sep 2006 19:39:12 +0000 (21:39 +0200)
Call iounmap after free_irq to avoid invalid accesses in the
shared irq.  The patch is taken from
        https://bugzilla.novell.com/show_bug.cgi?id=167869

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
sound/pci/hda/hda_intel.c

index fd12b6991fe403f3af807ce933dfb35f2395e134..0ff38cbe7471276eef0a41e07fc95eb4746b0955 100644 (file)
@@ -1364,10 +1364,10 @@ static int azx_free(struct azx *chip)
                msleep(1);
        }
 
-       if (chip->remap_addr)
-               iounmap(chip->remap_addr);
        if (chip->irq >= 0)
                free_irq(chip->irq, (void*)chip);
+       if (chip->remap_addr)
+               iounmap(chip->remap_addr);
 
        if (chip->bdl.area)
                snd_dma_free_pages(&chip->bdl);