aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/trident
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/trident
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/trident')
-rw-r--r--sound/pci/trident/trident_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 71138ff9b310..bbcee2c09ae4 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3676,6 +3676,8 @@ static int snd_trident_free(struct snd_trident *trident)
3676 else if (trident->device == TRIDENT_DEVICE_ID_SI7018) { 3676 else if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
3677 outl(0, TRID_REG(trident, SI_SERIAL_INTF_CTRL)); 3677 outl(0, TRID_REG(trident, SI_SERIAL_INTF_CTRL));
3678 } 3678 }
3679 if (trident->irq >= 0)
3680 free_irq(trident->irq, trident);
3679 if (trident->tlb.buffer.area) { 3681 if (trident->tlb.buffer.area) {
3680 outl(0, TRID_REG(trident, NX_TLBC)); 3682 outl(0, TRID_REG(trident, NX_TLBC));
3681 if (trident->tlb.memhdr) 3683 if (trident->tlb.memhdr)
@@ -3685,8 +3687,6 @@ static int snd_trident_free(struct snd_trident *trident)
3685 vfree(trident->tlb.shadow_entries); 3687 vfree(trident->tlb.shadow_entries);
3686 snd_dma_free_pages(&trident->tlb.buffer); 3688 snd_dma_free_pages(&trident->tlb.buffer);
3687 } 3689 }
3688 if (trident->irq >= 0)
3689 free_irq(trident->irq, trident);
3690 pci_release_regions(trident->pci); 3690 pci_release_regions(trident->pci);
3691 pci_disable_device(trident->pci); 3691 pci_disable_device(trident->pci);
3692 kfree(trident); 3692 kfree(trident);