sound: oss: msnd: check request_region() return value
authorKulikov Vasiliy <segooon@gmail.com>
Thu, 29 Jul 2010 10:45:50 +0000 (14:45 +0400)
committerTakashi Iwai <tiwai@suse.de>
Thu, 29 Jul 2010 11:48:57 +0000 (13:48 +0200)
request_region() may fail, if so return -EBUSY.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/oss/msnd_pinnacle.c

index bfaac5f..2e48b17 100644 (file)
@@ -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;