pcwatchdog firmware memory leak
davej@codemonkey.org.uk
Thu, 15 May 2003 04:31:04 +0100
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/char/watchdog/pcwd.c linux-2.5/drivers/char/watchdog/pcwd.c
--- bk-linus/drivers/char/watchdog/pcwd.c 2003-04-25 13:53:15.000000000 +0100
+++ linux-2.5/drivers/char/watchdog/pcwd.c 2003-04-26 15:08:04.000000000 +0100
@@ -594,6 +594,7 @@ static void __init pcwd_validate_timeout
static int __init pcwatchdog_init(void)
{
+ char *firmware;
int i, found = 0;
pcwd_validate_timeout();
spin_lock_init(&io_lock);
@@ -633,10 +634,12 @@ static int __init pcwatchdog_init(void)
if (revision == PCWD_REVISION_A)
printk(KERN_INFO "pcwd: PC Watchdog (REV.A) detected at port 0x%03x\n", current_readport);
- else if (revision == PCWD_REVISION_C)
+ else if (revision == PCWD_REVISION_C) {
+ firmware = get_firmware();
printk(KERN_INFO "pcwd: PC Watchdog (REV.C) detected at port 0x%03x (Firmware version: %s)\n",
- current_readport, get_firmware());
- else {
+ current_readport, firmware);
+ kfree(firmware);
+ } else {
/* Should NEVER happen, unless get_revision() fails. */
printk("pcwd: Unable to get revision.\n");
return -1;
-
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/