All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix resource leak in isapnp
@ 2006-03-18 23:52 Jesper Juhl
  0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2006-03-18 23:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jaroslav Kysela, Jesper Juhl


We may leak memory in drivers/pnp/isapnp/core.c::isapnp_create_device()
Spotted by the Coverity checker as bug #666 - this should fix it.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/pnp/isapnp/core.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.16-rc6-orig/drivers/pnp/isapnp/core.c	2006-01-03 04:21:10.000000000 +0100
+++ linux-2.6.16-rc6/drivers/pnp/isapnp/core.c	2006-03-19 00:49:04.000000000 +0100
@@ -646,8 +646,10 @@ static int __init isapnp_create_device(s
 				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;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-18 23:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-18 23:52 [PATCH] Fix resource leak in isapnp Jesper Juhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.