public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] class: Free the class private data in class_unregister
@ 2010-02-10 11:35 Laurent Pinchart
  2010-02-10 12:32 ` [PATCH v2] class: Free the class private data in class_release Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2010-02-10 11:35 UTC (permalink / raw)
  To: gregkh; +Cc: kay.sievers, linux-kernel, artem.bityutskiy

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>
---
 drivers/base/class.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 161746d..a9449b3 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -200,6 +200,7 @@ void class_unregister(struct class *cls)
 	pr_debug("device class '%s': unregistering\n", cls->name);
 	remove_class_attrs(cls);
 	kset_unregister(&cls->p->class_subsys);
+	kfree(cls->p);
 }
 
 static void class_create_release(struct class *cls)
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-12 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 11:35 [PATCH] class: Free the class private data in class_unregister Laurent Pinchart
2010-02-10 12:32 ` [PATCH v2] class: Free the class private data in class_release Laurent Pinchart
2010-02-10 16:05   ` Artem Bityutskiy
2010-02-12  7:16   ` Artem Bityutskiy
2010-02-12 15:19     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox