提交 656bde57 编写于 作者: J Jesper Juhl 提交者: Linus Torvalds

[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: NJesper Juhl <jesper.juhl@gmail.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 bda44e1d
......@@ -646,8 +646,10 @@ static int __init isapnp_create_device(struct pnp_card *card,
size = 0;
skip = 0;
option = pnp_register_independent_option(dev);
if (!option)
if (!option) {
kfree(dev);
return 1;
}
pnp_add_card_device(card,dev);
} else {
skip = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册