lkml.org 
[lkml]   [2008]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] Fix "notes" kobject leak
On Tue, Sep 23, 2008 at 11:51:11PM +0400, Alexey Dobriyan wrote:
> > > > > --- a/kernel/module.c
> > > > > +++ b/kernel/module.c
> > > > > @@ -1174,6 +1174,7 @@ static void free_notes_attrs(struct module_notes_attrs *notes_attrs,
> > > > > sysfs_remove_bin_file(notes_attrs->dir,
> > > > > &notes_attrs->attrs[i]);
> > > > > kobject_del(notes_attrs->dir);
> > > > > + kobject_put(notes_attrs->dir);
> > > >
> > > > Hm, no, that should just be a call to kobject_put() instead of
> > > > kobject_del(), can you try that instead and see if that solves the issue
> > > > (am at a conference and can't test that at the moment, sorry.)
> > >
> > > Why?! kobject_del() puts parent kobject.
> >
> > And that's about it (well, it also tears down the sysfs stuff.)
> >
> > If you call kobject_put() instead, and it's the last put, it will also
> > call kobject_del() and do everything else that it needs to do.
> >
> > Try it and let me know if I'm right or not :)
>
> OK, this works too.
>
>
> [PATCH v2] Fix "notes" kobject leak

Great, thanks for testing, I'll apply this to my trees.

greg k-h


\
 
 \ /
  Last update: 2008-09-23 23:03    [W:0.608 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site