diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-29 12:45:50 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-29 13:48:57 +0200 |
commit | 9c29490246ed80975ab8b87bcd4ebe5b87c1c1d6 (patch) | |
tree | bd20d40cc243649252a8afe6a749804f1960985c /sound/oss/msnd_pinnacle.c | |
parent | ALSA: msnd: check request_region() return value (diff) | |
download | linux-9c29490246ed80975ab8b87bcd4ebe5b87c1c1d6.tar.xz linux-9c29490246ed80975ab8b87bcd4ebe5b87c1c1d6.zip |
sound: oss: 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/oss/msnd_pinnacle.c')
-rw-r--r-- | sound/oss/msnd_pinnacle.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c index bfaac5fa13d7..2e48b17667d0 100644 --- a/sound/oss/msnd_pinnacle.c +++ b/sound/oss/msnd_pinnacle.c @@ -1400,9 +1400,13 @@ static int __init attach_multisound(void) printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", dev.irq); return err; } - request_region(dev.io, dev.numio, dev.name); + if (request_region(dev.io, dev.numio, dev.name) == NULL) { + free_irq(dev.irq, &dev); + return -EBUSY; + } - if ((err = dsp_full_reset()) < 0) { + err = dsp_full_reset(); + if (err < 0) { release_region(dev.io, dev.numio); free_irq(dev.irq, &dev); return err; |