From fe64daa043515e3eb3f2a6a2c626e39cf4cd25ea Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Thu, 2 Sep 2004 00:38:52 -0700 Subject: [PATCH] [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 Signed-off-by: Linus Torvalds --- drivers/pnp/isapnp/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index ee6d1ed502ff9..bf52990a8e914 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -655,8 +655,10 @@ static int __init isapnp_create_device(struct pnp_card *card, 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) { -- 2.53.0