* [KJ][Patch][update] check return value of request_region in
@ 2006-03-01 7:29 Darren Jenkins\
2006-03-01 8:07 ` Tim Cooijmans
2006-03-24 12:02 ` [KJ][Patch][update] check return value of request_irq in pcnet_cs.c Darren Jenkins\
0 siblings, 2 replies; 3+ messages in thread
From: Darren Jenkins\ @ 2006-03-01 7:29 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
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.
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
--- linux-2.6.16-rc5/sound/oss/ali5455.c.orig 2006-03-01 17:52:40.000000000 +1100
+++ linux-2.6.16-rc5/sound/oss/ali5455.c 2006-03-01 18:25:34.000000000 +1100
@@ -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",
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [KJ][Patch][update] check return value of request_region in
2006-03-01 7:29 [KJ][Patch][update] check return value of request_region in Darren Jenkins\
@ 2006-03-01 8:07 ` Tim Cooijmans
2006-03-24 12:02 ` [KJ][Patch][update] check return value of request_irq in pcnet_cs.c Darren Jenkins\
1 sibling, 0 replies; 3+ messages in thread
From: Tim Cooijmans @ 2006-03-01 8:07 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
On Wednesday 01 March 2006 08:29, Darren Jenkins\ wrote:
> + 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
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread* [KJ][Patch][update] check return value of request_irq in pcnet_cs.c
2006-03-01 7:29 [KJ][Patch][update] check return value of request_region in Darren Jenkins\
2006-03-01 8:07 ` Tim Cooijmans
@ 2006-03-24 12:02 ` Darren Jenkins\
1 sibling, 0 replies; 3+ messages in thread
From: Darren Jenkins\ @ 2006-03-24 12:02 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]
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.
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
--- linux-2.6.16-git8/drivers/net/pcmcia/pcnet_cs.c.orig 2006-03-21 23:42:54.000000000 +1100
+++ linux-2.6.16-git8/drivers/net/pcmcia/pcnet_cs.c 2006-03-24 21:01:15.000000000 +1100
@@ -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;
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-24 12:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01 7:29 [KJ][Patch][update] check return value of request_region in Darren Jenkins\
2006-03-01 8:07 ` Tim Cooijmans
2006-03-24 12:02 ` [KJ][Patch][update] check return value of request_irq in pcnet_cs.c Darren Jenkins\
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).