[patch 1/1] OSS ali5455 missing return check for request_region()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
in sound/oss/ali5455.c, request_region() is called without checking the return
value. Here is a simple patch to fix it.
Please apply, even if OSS is aimed at /dev/null some day :-)
Patch applies cleanly on 2.6.16-rc6 and 2.6.16-rc6-git8.
Regards.

Signed-off-by: Laurent Wandrebeck <[email protected]>

--- linux-2.6.16-rc6-low/sound/oss/ali5455.c.ori        2006-03-11
23:12:55.000000000 +0100
+++ linux-2.6.16-rc6-low/sound/oss/ali5455.c    2006-03-16 23:45:27.316837000
+0100
@@ -3457,7 +3457,12 @@ static int __devinit ali_probe(struct pc
        card->channel[4].port = 0xb0;
        card->channel[4].num = 4;
        /* claim our iospace and irq */
-       request_region(card->iobase, 256, card_names[pci_id->driver_data]);
+       if (request_region(card->iobase, 256, card_names[pci_id->driver_data]) <
0) {
+               printk(KERN_ERR "ali_audio: unable to reserve region %d\n",
+                                card->iobase);
+               kfree(card);
+               return -ENODEV;
+       }
        if (request_irq(card->irq, &ali_interrupt, SA_SHIRQ,
                        card_names[pci_id->driver_data], card)) {
                printk(KERN_ERR "ali_audio: unable to allocate irq %d\n",
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux