lkml.org 
[lkml]   [2002]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC][PATCH] (2/3) unchecked request_region's in drivers/net
These patches were approved by their respective maintainers, and can
hopefully be assumed to be bugfree (or at least introduce no new bugs).

The next message will have patches for drivers whose maintainers didn't
respond, and should be eyed carefully.

Andrew, hopefully I've fixed all the errors you adeptly found.
--
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
-- George Orwell
He's alive. He's alive! Oh, that fellow at RadioShack said I was mad!
Well, who's mad now?
-- Montgomery C. Burns

--- linux/drivers/net/arcnet/com90io.c~ Sat Jan 12 23:33:14 2002
+++ linux/drivers/net/arcnet/com90io.c Sat Jan 12 23:34:03 2002
@@ -241,7 +241,10 @@
return -ENODEV;
}
/* Reserve the I/O region - guaranteed to work by check_region */
- request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)");
+ if (!request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)")) {
+ free_irq(dev->irq, dev);
+ return -EBUSY;
+ }

/* Initialize the rest of the device structure. */
dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
--- linux/drivers/net/sb1000.c~ Sat Jan 12 23:36:00 2002
+++ linux/drivers/net/sb1000.c Sat Jan 12 23:42:58 2002
@@ -204,7 +204,12 @@
/*
* Ok set it up.
*/
-
+ if (!request_region(ioaddr[0], 16, dev->name))
+ continue;
+ if (!request_region(ioaddr[1], 16, dev->name)) {
+ release_region(ioaddr[0], 16);
+ continue;
+ }

dev->base_addr = ioaddr[0];
/* rmem_end holds the second I/O address - fv */
@@ -262,9 +267,6 @@

/* Lock resources */

- request_region(ioaddr[0], 16, dev->name);
- request_region(ioaddr[1], 16, dev->name);
-
return 0;
}
}
@@ -962,8 +964,6 @@
/* rmem_end holds the second I/O address - fv */
ioaddr[1] = dev->rmem_end;
name = dev->name;
- request_region(ioaddr[0], SB1000_IO_EXTENT, "sb1000");
- request_region(ioaddr[1], SB1000_IO_EXTENT, "sb1000");

/* initialize sb1000 */
if ((status = sb1000_reset(ioaddr, name)))
diff -Nru clean-2.4.17//drivers/net/wan/sealevel.c linux/drivers/net/wan/sealevel.c
--- clean-2.4.17//drivers/net/wan/sealevel.c Mon Nov 5 19:23:14 2001
+++ linux/drivers/net/wan/sealevel.c Thu Dec 27 14:18:21 2001
@@ -219,12 +219,11 @@
* Get the needed I/O space
*/

- if(check_region(iobase, 8))
+ if(!request_region(iobase, 8, "Sealevel 4021"))
{
printk(KERN_WARNING "sealevel: I/O 0x%X already in use.\n", iobase);
return NULL;
}
- request_region(iobase, 8, "Sealevel 4021");

b=(struct slvl_board *)kmalloc(sizeof(struct slvl_board), GFP_KERNEL);
if(!b)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:18    [W:0.029 / U:1.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site