@@ -552,17 +552,16 @@ static int snd_msnd_attach(struct snd_card *card)
return err;
}
if (request_region(chip->io, DSP_NUMIO, card->shortname) == NULL) {
- free_irq(chip->irq, chip);
- return -EBUSY;
+ err = -EBUSY;
+ goto free_an_irq;
}
if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) {
printk(KERN_ERR LOGNAME
": unable to grab memory region 0x%lx-0x%lx\n",
chip->base, chip->base + BUFFSIZE - 1);
- release_region(chip->io, DSP_NUMIO);
- free_irq(chip->irq, chip);
- return -EBUSY;
+ err = -EBUSY;
+ goto release_resource_region;
}
chip->mappedbase = ioremap_nocache(chip->base, 0x8000);
if (!chip->mappedbase) {
@@ -570,7 +569,7 @@ static int snd_msnd_attach(struct snd_card *card)
": unable to map memory region 0x%lx-0x%lx\n",
chip->base, chip->base + BUFFSIZE - 1);
err = -EIO;
- goto err_release_region;
+ goto release_memory_region;
}
err = snd_msnd_dsp_full_reset(card);
@@ -628,9 +627,11 @@ static int snd_msnd_attach(struct snd_card *card)
io_unmap:
iounmap(chip->mappedbase);
-err_release_region:
+release_memory_region:
release_mem_region(chip->base, BUFFSIZE);
+release_resource_region:
release_region(chip->io, DSP_NUMIO);
+free_an_irq:
free_irq(chip->irq, chip);
return err;
}