From 688956f23bdbfb1c3551bfafc819f989b36bb8ae Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 6 Jun 2006 15:44:34 +0200 Subject: [ALSA] Fix races in irq handler and ioremap Call ioremap before request_irq for avoiding possible races in the irq handler. Signed-off-by: Takashi Iwai Signed-off-by: Takashi Iwai --- sound/pci/cs4281.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sound/pci/cs4281.c') diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 8c150eab45b..e77a4ce314b 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1379,6 +1379,13 @@ static int __devinit snd_cs4281_create(struct snd_card *card, chip->ba0_addr = pci_resource_start(pci, 0); chip->ba1_addr = pci_resource_start(pci, 1); + chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0)); + chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1)); + if (!chip->ba0 || !chip->ba1) { + snd_cs4281_free(chip); + return -ENOMEM; + } + if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ, "CS4281", chip)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); @@ -1387,13 +1394,6 @@ static int __devinit snd_cs4281_create(struct snd_card *card, } chip->irq = pci->irq; - chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0)); - chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1)); - if (!chip->ba0 || !chip->ba1) { - snd_cs4281_free(chip); - return -ENOMEM; - } - tmp = snd_cs4281_chip_init(chip); if (tmp) { snd_cs4281_free(chip); -- cgit v1.2.3