Commit 901294f1 authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds

[PATCH] i810_audio: Fix the error path of resource management

The patch adds the check of return value from resquest_region() to avoid
the confliction of resource management with ALSA intel8x0 driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 55cdbf47
......@@ -3216,8 +3216,14 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
}
/* claim our iospace and irq */
request_region(card->iobase, 64, card_names[pci_id->driver_data]);
request_region(card->ac97base, 256, card_names[pci_id->driver_data]);
if (!request_region(card->iobase, 64, card_names[pci_id->driver_data])) {
printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->iobase);
goto out_region1;
}
if (!request_region(card->ac97base, 256, card_names[pci_id->driver_data])) {
printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->ac97base);
goto out_region2;
}
if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,
card_names[pci_id->driver_data], card)) {
......@@ -3291,7 +3297,9 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
}
out_pio:
release_region(card->iobase, 64);
out_region2:
release_region(card->ac97base, 256);
out_region1:
pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,
card->channel, card->chandma);
out_mem:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment