From: Laurent Pinchart Date: Wed, 10 Feb 2010 12:32:49 +0000 (+0100) Subject: class: Free the class private data in class_release X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=18d19c96457d172d913510c083bc7411ed40cb10;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git class: Free the class private data in class_release Fix a memory leak by freeing the memory allocated in __class_register for the class private data. Signed-off-by: Laurent Pinchart Acked-by: Artem Bityutskiy Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/class.c b/drivers/base/class.c index 161746deab4b..6e2c3b064f53 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 = {