check return value of request_region in
Subsystems (3)
PATCH 1/1 check return value of request_region in
G'day list,
Sorry about the last patch I forgot to compile test it first. Here is the patch you want.
matroxfb_base.c calles 'request_region' @ 1737 without checking the return value.
The patch below adds a check for this and plugs into the existing error path.
sound/oss/ali5455.c renamed from sound/oss/ali5455.c.orig +7 -1
@@ -3457,7 +3457,13 @@ 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])) { +printk (KERN_ERR "ali_audio: request_region failed" ); +kfree (card); +return -EBUSY ; + } +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",
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
sound/oss/ali5455.c static int __devinit ali_probe(struct pc · line 3465
Quoted 6 lines · Darren Jenkins\
sound/oss/ali5455.c renamed from sound/oss/ali5455.c.orig +6
-0+if (!request_region (card->iobase,256 , + card_names[pci_id->driver_data])) { +printk (KERN_ERR "ali_audio: request_region failed" ); +kfree (card); +return -EBUSY ; + }
You forgot a \n there.
Tim
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
PATCH 1/1 check return value of request_irq in pcnet_cs.c
In reply to Darren Jenkins\G'day list
Here is an updated patch that will apply to a clean tree. The only difference between it and the last patch is, it is against the correctly named file.
This patch is compile tested.
pcnet_cs.c called request_irq without checking its return value @ line 1036.
The patch below just checks the return value and returns -EBUSY on failure.
drivers/net/pcmcia/pcnet_cs.c renamed from drivers/net/pcmcia/pcnet_cs.c.orig +2 -1
@@ -1033,7 +1033,8 @@ static int pcnet_open(struct net_device link->open++;set_misc_reg (dev); -request_irq (dev->irq, ei_irq_wrapper,SA_SHIRQ , dev_info, dev); +if (request_irq (dev->irq, ei_irq_wrapper,SA_SHIRQ , dev_info, dev) <0 ) +return -EBUSY ; info->phy_id = info->eth_phy; info->link_status =0x00 ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors