Skip to content

Commit

Permalink
ALSA: msnd: check request_region() return value
Browse files Browse the repository at this point in the history
request_region() may fail, if so return -EBUSY.

Signed-off-by: Kulikov Vasiliy <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
segoon authored and tiwai committed Jul 29, 2010
1 parent ec9d04b commit fa95a64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/isa/msnd/msnd_pinnacle.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,10 @@ static int __devinit snd_msnd_attach(struct snd_card *card)
printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", chip->irq);
return err;
}
request_region(chip->io, DSP_NUMIO, card->shortname);
if (request_region(chip->io, DSP_NUMIO, card->shortname) == NULL) {
free_irq(chip->irq, chip);
return -EBUSY;
}

if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) {
printk(KERN_ERR LOGNAME
Expand Down

0 comments on commit fa95a64

Please sign in to comment.