diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-29 14:45:24 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-29 13:48:39 +0200 |
commit | fa95a6471ffaa6f40d71f44fc4d4636ee17280f5 (patch) | |
tree | a712f44aba53420bff10b5f36fe6b20c2e8641e1 /sound | |
parent | ec9d04b2a8f00b14a3df4714820cb2cda46dc4d6 (diff) |
ALSA: msnd: check request_region() return value
request_region() may fail, if so return -EBUSY.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/msnd/msnd_pinnacle.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c index 60b6abd7161..5f3e68401f9 100644 --- a/sound/isa/msnd/msnd_pinnacle.c +++ b/sound/isa/msnd/msnd_pinnacle.c @@ -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 |