]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - sound/pci/rme32.c
[ALSA] Fix races in irq handler and ioremap
[mirror_ubuntu-zesty-kernel.git] / sound / pci / rme32.c
index 4dd53bfe0308142432737fa6deeea07052203b88..2cb9fe98db2f51f43ba2bbe1ba51c929f9d1c667 100644 (file)
@@ -1368,18 +1368,18 @@ static int __devinit snd_rme32_create(struct rme32 * rme32)
                return err;
        rme32->port = pci_resource_start(rme32->pci, 0);
 
-       if (request_irq(pci->irq, snd_rme32_interrupt, SA_INTERRUPT | SA_SHIRQ, "RME32", (void *) rme32)) {
-               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
-               return -EBUSY;
-       }
-       rme32->irq = pci->irq;
-
        if ((rme32->iobase = ioremap_nocache(rme32->port, RME32_IO_SIZE)) == 0) {
                snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n",
                           rme32->port, rme32->port + RME32_IO_SIZE - 1);
                return -ENOMEM;
        }
 
+       if (request_irq(pci->irq, snd_rme32_interrupt, SA_INTERRUPT | SA_SHIRQ, "RME32", (void *) rme32)) {
+               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+               return -EBUSY;
+       }
+       rme32->irq = pci->irq;
+
        /* read the card's revision number */
        pci_read_config_byte(pci, 8, &rme32->rev);