lkml.org 
[lkml]   [2010]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[78/93] class: Free the class private data in class_release
2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

commit 18d19c96457d172d913510c083bc7411ed40cb10 upstream.

Fix a memory leak by freeing the memory allocated in __class_register
for the class private data.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/base/class.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -59,6 +59,8 @@ static void class_release(struct kobject
else
pr_debug("class '%s' does not have a release() function, "
"be careful\n", class->name);
+
+ kfree(cp);
}

static struct sysfs_ops class_sysfs_ops = {



\
 
 \ /
  Last update: 2010-02-19 18:09    [from the cache]
©2003-2011 Jasper Spaans