summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-02-10 13:32:49 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 15:55:53 -0700
commit6590bda22d4fd456ddbf8e70077e247d3014c333 (patch)
treedd5e2445eb9fb716e681f5bf2ba3038fda515591
parenta0a4650a9de3ceab90cd3b0588843886513bae77 (diff)
class: Free the class private data in class_release
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>
-rw-r--r--drivers/base/class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index eb85e4312301..4317d4ca540a 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -59,6 +59,8 @@ static void class_release(struct kobject *kobj)
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 = {