2001-10-09 03:27:30

by Thomas Hood

[permalink] [raw]
Subject: [PATCH] PnPBIOS bugfix (last of the first round of cleanups)

This patch is required so that we don't use memory that's been
kfree'd. (Corrects my mistake.) Also this makes the regionid
a bit more informative (as it appears in /proc/ioports).

--
Thomas

The patch:
--- linux-2.4.10-ac10/drivers/pnp/pnp_bios.c Mon Oct 8 22:41:14 2001
+++ linux-2.4.10-ac10-fx/drivers/pnp/pnp_bios.c Mon Oct 8 00:49:58 2001
@@ -686,17 +686,17 @@
* We really shouldn't just reserve these regions, though, since
* that prevents the device drivers from claiming them.
*/
- regionid = pnp_bios_kmalloc(8, GFP_KERNEL);
+ regionid = pnp_bios_kmalloc(16, GFP_KERNEL);
if ( regionid == NULL )
return;
- memcpy(regionid,pnpid,8);
+ sprintf(regionid, "PnPBIOS %s", pnpid);
res = request_region(io,len,regionid);
if ( res == NULL )
kfree( regionid );
printk(
- "PnPBIOS: %s: 0x%x-0x%x %s\n",
- regionid, io, io+len-1,
- NULL != res ? "reserved" : "was already reserved"
+ "PnPBIOS: %s: 0x%x-0x%x %s reserved\n",
+ pnpid, io, io+len-1,
+ NULL != res ? "has been" : "was already"
);

return;