2004-09-01 15:58:48

by Dave Jones

[permalink] [raw]
Subject: [PATCH] Fix leak in ISAPNP core

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 <[email protected]>


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) {