diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2006-03-25 06:08:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:23:00 -0500 |
commit | 656bde5728b824ca23fcab8bc5800b309ea48d64 (patch) | |
tree | 9e570f9e5847a653d8ab11e2653464f5b525cc53 /drivers/pnp | |
parent | bda44e1d168ac76fce5183eb141592fc645c7818 (diff) |
[PATCH] Fix memory leak in isapnp
Spotted by the Coverity checker as bug #666
akpm; there are several other `return 1;'s in there which aren't freeing
`dev'. (A fix which converts this function to single-exit would be
preferred..)
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/isapnp/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 57fd60314d59..b1b4b683cbdd 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -646,8 +646,10 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
646 | size = 0; | 646 | size = 0; |
647 | skip = 0; | 647 | skip = 0; |
648 | option = pnp_register_independent_option(dev); | 648 | option = pnp_register_independent_option(dev); |
649 | if (!option) | 649 | if (!option) { |
650 | kfree(dev); | ||
650 | return 1; | 651 | return 1; |
652 | } | ||
651 | pnp_add_card_device(card,dev); | 653 | pnp_add_card_device(card,dev); |
652 | } else { | 654 | } else { |
653 | skip = 1; | 655 | skip = 1; |