lkml.org 
[lkml]   [2010]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/28] dmi-id: fix a memory leak in dmi_id_init error path
Date
From: Axel Lin <axel.lin@gmail.com>

This patch adds a missing kfree(dmi_dev) in dmi_id_init error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/firmware/dmi-id.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index a777a35..94a58a0 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -229,10 +229,12 @@ static int __init dmi_id_init(void)

ret = device_register(dmi_dev);
if (ret)
- goto fail_class_unregister;
+ goto fail_free_dmi_dev;

return 0;

+fail_free_dmi_dev:
+ kfree(dmi_dev);
fail_class_unregister:

class_unregister(&dmi_class);
--
1.7.2


\
 
 \ /
  Last update: 2010-08-06 00:37    [from the cache]
©2003-2011 Jasper Spaans