Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 656bde57 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[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: default avatarJesper Juhl <jesper.juhl@gmail.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bda44e1d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;