[PATCH] Fix leak in ISAPNP core

From: Dave Jones
Date: Wed Sep 01 2004 - 11:07:02 EST


This looks odd, but there doesn't seem to be an
isapnp_free() or similar..

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <davej@xxxxxxxxxx>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/pnp/isapnp/core.c linux-2.6/drivers/pnp/isapnp/core.c
--- bk-linus/drivers/pnp/isapnp/core.c 2004-06-19 00:01:33.000000000 +0100
+++ linux-2.6/drivers/pnp/isapnp/core.c 2004-08-23 14:08:16.000000000 +0100
@@ -655,8 +655,10 @@ static int __init isapnp_create_device(s
if ((dev = isapnp_parse_device(card, size, number++)) == NULL)
return 1;
option = pnp_register_independent_option(dev);
- if (!option)
+ if (!option) {
+ kfree(dev);
return 1;
+ }
pnp_add_card_device(card,dev);

while (1) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/