lkml.org 
[lkml]   [2010]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] class: Free the class private data in class_release
On Fri, Feb 12, 2010 at 09:16:58AM +0200, Artem Bityutskiy wrote:
> On Wed, 2010-02-10 at 13:32 +0100, Laurent Pinchart wrote:
> > 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 | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/base/class.c b/drivers/base/class.c
> > index 161746d..6e2c3b0 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 = {
>
> This looks like 2.6.33 material for me. CC-ing Andrew.

Heh, I can handle .33 stuff just fine :)

thanks,

greg k-h


\
 
 \ /
  Last update: 2010-02-12 16:39    [W:0.093 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site