Skip to contentSkip to conversation

Fix leak in ISAPNP core

PATCH New Dave Jones 1 participant 1 message Sep 1, 2004

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

PATCH 1/1 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.

drivers/pnp/isapnp/core.c +3 -1
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/pnp/isapnp/core.c linux-2.6/drivers/pnp/isapnp/core.c
@@ -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) {