lkml.org 
[lkml]   [2006]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Fix resource leak in isapnp
Date

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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-19 00:55    [W:0.050 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site