public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kobject leak in next-20080829
@ 2008-08-30  4:42 Alexey Dobriyan
  2008-08-30  5:43 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Dobriyan @ 2008-08-30  4:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh

	size-32: 3511 kvasprintf+0x57/0x90
	size-64: 3059 kobject_create+0x1c/0x40

These two buddies increase after every "modprobe; rmmod" sequence.


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

* Re: kobject leak in next-20080829
  2008-08-30  4:42 kobject leak in next-20080829 Alexey Dobriyan
@ 2008-08-30  5:43 ` Greg KH
  2008-09-06  5:45   ` kobject leak in next-20080829 (and mainline) Alexey Dobriyan
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2008-08-30  5:43 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel

On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> 	size-32: 3511 kvasprintf+0x57/0x90
> 	size-64: 3059 kobject_create+0x1c/0x40
> 
> These two buddies increase after every "modprobe; rmmod" sequence.

Do they also do so in mainline?

thanks,

greg k-h

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

* Re: kobject leak in next-20080829 (and mainline)
  2008-08-30  5:43 ` Greg KH
@ 2008-09-06  5:45   ` Alexey Dobriyan
  2008-09-12 15:51     ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Dobriyan @ 2008-09-06  5:45 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, akpm

On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > 	size-32: 3511 kvasprintf+0x57/0x90
> > 	size-64: 3059 kobject_create+0x1c/0x40
> > 
> > These two buddies increase after every "modprobe; rmmod" sequence.
> 
> Do they also do so in mainline?

Yep, same bug in mainline.


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

* Re: kobject leak in next-20080829 (and mainline)
  2008-09-06  5:45   ` kobject leak in next-20080829 (and mainline) Alexey Dobriyan
@ 2008-09-12 15:51     ` Greg KH
  2008-09-14  8:42       ` [PATCH] Fix "notes" kobject leak Alexey Dobriyan
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2008-09-12 15:51 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel, akpm

On Sat, Sep 06, 2008 at 09:45:22AM +0400, Alexey Dobriyan wrote:
> On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> > On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > > 	size-32: 3511 kvasprintf+0x57/0x90
> > > 	size-64: 3059 kobject_create+0x1c/0x40
> > > 
> > > These two buddies increase after every "modprobe; rmmod" sequence.
> > 
> > Do they also do so in mainline?
> 
> Yep, same bug in mainline.

Not good.  Does 2.6.26 show this as well?

thanks,

greg k-h

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

* [PATCH] Fix "notes" kobject leak
  2008-09-12 15:51     ` Greg KH
@ 2008-09-14  8:42       ` Alexey Dobriyan
  2008-09-15 22:53         ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Dobriyan @ 2008-09-14  8:42 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, akpm

On Fri, Sep 12, 2008 at 08:51:05AM -0700, Greg KH wrote:
> On Sat, Sep 06, 2008 at 09:45:22AM +0400, Alexey Dobriyan wrote:
> > On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> > > On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > > > 	size-32: 3511 kvasprintf+0x57/0x90
> > > > 	size-64: 3059 kobject_create+0x1c/0x40
> > > > 
> > > > These two buddies increase after every "modprobe; rmmod" sequence.
> > > 
> > > Do they also do so in mainline?
> > 
> > Yep, same bug in mainline.
> 
> Not good.  Does 2.6.26 show this as well?

Uh-oh, this was actually 10-minute exercise.



[PATCH] Fix "notes" kobject leak

It happens every rmmod if KALLSYMS=y and SYSFS=y.

	# modprobe foo

kobject: 'foo' (ffffffffa00743d0): kobject_add_internal: parent: 'module', set: 'module'
kobject: 'holders' (ffff88017e7c5770): kobject_add_internal: parent: 'foo', set: '<NULL>'
kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
kobject: 'notes' (ffff88017fa9b668): kobject_add_internal: parent: 'foo', set: '<NULL>'
	  ^^^^^

	# rmmod foo

kobject: 'holders' (ffff88017e7c5770): kobject_cleanup
kobject: 'holders' (ffff88017e7c5770): auto cleanup kobject_del
kobject: 'holders' (ffff88017e7c5770): calling ktype release
kobject: (ffff88017e7c5770): dynamic_kobj_release
kobject: 'holders': free name
kobject: 'foo' (ffffffffa00743d0): kobject_cleanup
kobject: 'foo' (ffffffffa00743d0): does not have a release() function, it is broken and must be fixed.
kobject: 'foo' (ffffffffa00743d0): auto cleanup 'remove' event
kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
kobject: 'foo' (ffffffffa00743d0): auto cleanup kobject_del
kobject: 'foo': free name

	[whooops]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 kernel/module.c |    1 +
 1 file changed, 1 insertion(+)

--- 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);
 	}
 	kfree(notes_attrs);
 }

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

* Re: [PATCH] Fix "notes" kobject leak
  2008-09-14  8:42       ` [PATCH] Fix "notes" kobject leak Alexey Dobriyan
@ 2008-09-15 22:53         ` Greg KH
  2008-09-15 23:35           ` Alexey Dobriyan
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2008-09-15 22:53 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel, akpm

On Sun, Sep 14, 2008 at 12:42:25PM +0400, Alexey Dobriyan wrote:
> On Fri, Sep 12, 2008 at 08:51:05AM -0700, Greg KH wrote:
> > On Sat, Sep 06, 2008 at 09:45:22AM +0400, Alexey Dobriyan wrote:
> > > On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> > > > On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > > > > 	size-32: 3511 kvasprintf+0x57/0x90
> > > > > 	size-64: 3059 kobject_create+0x1c/0x40
> > > > > 
> > > > > These two buddies increase after every "modprobe; rmmod" sequence.
> > > > 
> > > > Do they also do so in mainline?
> > > 
> > > Yep, same bug in mainline.
> > 
> > Not good.  Does 2.6.26 show this as well?
> 
> Uh-oh, this was actually 10-minute exercise.
> 
> 
> 
> [PATCH] Fix "notes" kobject leak
> 
> It happens every rmmod if KALLSYMS=y and SYSFS=y.
> 
> 	# modprobe foo
> 
> kobject: 'foo' (ffffffffa00743d0): kobject_add_internal: parent: 'module', set: 'module'
> kobject: 'holders' (ffff88017e7c5770): kobject_add_internal: parent: 'foo', set: '<NULL>'
> kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> kobject: 'notes' (ffff88017fa9b668): kobject_add_internal: parent: 'foo', set: '<NULL>'
> 	  ^^^^^
> 
> 	# rmmod foo
> 
> kobject: 'holders' (ffff88017e7c5770): kobject_cleanup
> kobject: 'holders' (ffff88017e7c5770): auto cleanup kobject_del
> kobject: 'holders' (ffff88017e7c5770): calling ktype release
> kobject: (ffff88017e7c5770): dynamic_kobj_release
> kobject: 'holders': free name
> kobject: 'foo' (ffffffffa00743d0): kobject_cleanup
> kobject: 'foo' (ffffffffa00743d0): does not have a release() function, it is broken and must be fixed.
> kobject: 'foo' (ffffffffa00743d0): auto cleanup 'remove' event
> kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> kobject: 'foo' (ffffffffa00743d0): auto cleanup kobject_del
> kobject: 'foo': free name
> 
> 	[whooops]
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  kernel/module.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- 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.)

thanks,

greg k-h

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

* Re: [PATCH] Fix "notes" kobject leak
  2008-09-15 22:53         ` Greg KH
@ 2008-09-15 23:35           ` Alexey Dobriyan
  2008-09-15 23:40             ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Dobriyan @ 2008-09-15 23:35 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, akpm

On Mon, Sep 15, 2008 at 03:53:22PM -0700, Greg KH wrote:
> On Sun, Sep 14, 2008 at 12:42:25PM +0400, Alexey Dobriyan wrote:
> > On Fri, Sep 12, 2008 at 08:51:05AM -0700, Greg KH wrote:
> > > On Sat, Sep 06, 2008 at 09:45:22AM +0400, Alexey Dobriyan wrote:
> > > > On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> > > > > On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > > > > > 	size-32: 3511 kvasprintf+0x57/0x90
> > > > > > 	size-64: 3059 kobject_create+0x1c/0x40
> > > > > > 
> > > > > > These two buddies increase after every "modprobe; rmmod" sequence.
> > > > > 
> > > > > Do they also do so in mainline?
> > > > 
> > > > Yep, same bug in mainline.
> > > 
> > > Not good.  Does 2.6.26 show this as well?
> > 
> > Uh-oh, this was actually 10-minute exercise.
> > 
> > 
> > 
> > [PATCH] Fix "notes" kobject leak
> > 
> > It happens every rmmod if KALLSYMS=y and SYSFS=y.
> > 
> > 	# modprobe foo
> > 
> > kobject: 'foo' (ffffffffa00743d0): kobject_add_internal: parent: 'module', set: 'module'
> > kobject: 'holders' (ffff88017e7c5770): kobject_add_internal: parent: 'foo', set: '<NULL>'
> > kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> > kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> > kobject: 'notes' (ffff88017fa9b668): kobject_add_internal: parent: 'foo', set: '<NULL>'
> > 	  ^^^^^
> > 
> > 	# rmmod foo
> > 
> > kobject: 'holders' (ffff88017e7c5770): kobject_cleanup
> > kobject: 'holders' (ffff88017e7c5770): auto cleanup kobject_del
> > kobject: 'holders' (ffff88017e7c5770): calling ktype release
> > kobject: (ffff88017e7c5770): dynamic_kobj_release
> > kobject: 'holders': free name
> > kobject: 'foo' (ffffffffa00743d0): kobject_cleanup
> > kobject: 'foo' (ffffffffa00743d0): does not have a release() function, it is broken and must be fixed.
> > kobject: 'foo' (ffffffffa00743d0): auto cleanup 'remove' event
> > kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> > kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> > kobject: 'foo' (ffffffffa00743d0): auto cleanup kobject_del
> > kobject: 'foo': free name
> > 
> > 	[whooops]
> > 
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > ---
> > 
> >  kernel/module.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > --- 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.

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

* Re: [PATCH] Fix "notes" kobject leak
  2008-09-15 23:35           ` Alexey Dobriyan
@ 2008-09-15 23:40             ` Greg KH
  2008-09-23 19:51               ` [PATCH v2] " Alexey Dobriyan
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2008-09-15 23:40 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel, akpm

On Tue, Sep 16, 2008 at 03:35:04AM +0400, Alexey Dobriyan wrote:
> On Mon, Sep 15, 2008 at 03:53:22PM -0700, Greg KH wrote:
> > On Sun, Sep 14, 2008 at 12:42:25PM +0400, Alexey Dobriyan wrote:
> > > On Fri, Sep 12, 2008 at 08:51:05AM -0700, Greg KH wrote:
> > > > On Sat, Sep 06, 2008 at 09:45:22AM +0400, Alexey Dobriyan wrote:
> > > > > On Fri, Aug 29, 2008 at 10:43:43PM -0700, Greg KH wrote:
> > > > > > On Sat, Aug 30, 2008 at 08:42:46AM +0400, Alexey Dobriyan wrote:
> > > > > > > 	size-32: 3511 kvasprintf+0x57/0x90
> > > > > > > 	size-64: 3059 kobject_create+0x1c/0x40
> > > > > > > 
> > > > > > > These two buddies increase after every "modprobe; rmmod" sequence.
> > > > > > 
> > > > > > Do they also do so in mainline?
> > > > > 
> > > > > Yep, same bug in mainline.
> > > > 
> > > > Not good.  Does 2.6.26 show this as well?
> > > 
> > > Uh-oh, this was actually 10-minute exercise.
> > > 
> > > 
> > > 
> > > [PATCH] Fix "notes" kobject leak
> > > 
> > > It happens every rmmod if KALLSYMS=y and SYSFS=y.
> > > 
> > > 	# modprobe foo
> > > 
> > > kobject: 'foo' (ffffffffa00743d0): kobject_add_internal: parent: 'module', set: 'module'
> > > kobject: 'holders' (ffff88017e7c5770): kobject_add_internal: parent: 'foo', set: '<NULL>'
> > > kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> > > kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> > > kobject: 'notes' (ffff88017fa9b668): kobject_add_internal: parent: 'foo', set: '<NULL>'
> > > 	  ^^^^^
> > > 
> > > 	# rmmod foo
> > > 
> > > kobject: 'holders' (ffff88017e7c5770): kobject_cleanup
> > > kobject: 'holders' (ffff88017e7c5770): auto cleanup kobject_del
> > > kobject: 'holders' (ffff88017e7c5770): calling ktype release
> > > kobject: (ffff88017e7c5770): dynamic_kobj_release
> > > kobject: 'holders': free name
> > > kobject: 'foo' (ffffffffa00743d0): kobject_cleanup
> > > kobject: 'foo' (ffffffffa00743d0): does not have a release() function, it is broken and must be fixed.
> > > kobject: 'foo' (ffffffffa00743d0): auto cleanup 'remove' event
> > > kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
> > > kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
> > > kobject: 'foo' (ffffffffa00743d0): auto cleanup kobject_del
> > > kobject: 'foo': free name
> > > 
> > > 	[whooops]
> > > 
> > > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > > ---
> > > 
> > >  kernel/module.c |    1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > --- 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 :)

thanks,

greg k-h

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

* [PATCH v2] Fix "notes" kobject leak
  2008-09-15 23:40             ` Greg KH
@ 2008-09-23 19:51               ` Alexey Dobriyan
  2008-09-23 20:56                 ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Dobriyan @ 2008-09-23 19:51 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, akpm

> > > > --- 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

It happens every rmmod if KALLSYMS=y and SYSFS=y.

	# modprobe foo

kobject: 'foo' (ffffffffa00743d0): kobject_add_internal: parent: 'module', set: 'module'
kobject: 'holders' (ffff88017e7c5770): kobject_add_internal: parent: 'foo', set: '<NULL>'
kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
kobject: 'notes' (ffff88017fa9b668): kobject_add_internal: parent: 'foo', set: '<NULL>'
	  ^^^^^

	# rmmod foo

kobject: 'holders' (ffff88017e7c5770): kobject_cleanup
kobject: 'holders' (ffff88017e7c5770): auto cleanup kobject_del
kobject: 'holders' (ffff88017e7c5770): calling ktype release
kobject: (ffff88017e7c5770): dynamic_kobj_release
kobject: 'holders': free name
kobject: 'foo' (ffffffffa00743d0): kobject_cleanup
kobject: 'foo' (ffffffffa00743d0): does not have a release() function, it is broken and must be fixed.
kobject: 'foo' (ffffffffa00743d0): auto cleanup 'remove' event
kobject: 'foo' (ffffffffa00743d0): kobject_uevent_env
kobject: 'foo' (ffffffffa00743d0): fill_kobj_path: path = '/module/foo'
kobject: 'foo' (ffffffffa00743d0): auto cleanup kobject_del
kobject: 'foo': free name

	[whooops]

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 kernel/module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1173,7 +1173,7 @@ static void free_notes_attrs(struct module_notes_attrs *notes_attrs,
 		while (i-- > 0)
 			sysfs_remove_bin_file(notes_attrs->dir,
 					      &notes_attrs->attrs[i]);
-		kobject_del(notes_attrs->dir);
+		kobject_put(notes_attrs->dir);
 	}
 	kfree(notes_attrs);
 }

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

* Re: [PATCH v2] Fix "notes" kobject leak
  2008-09-23 19:51               ` [PATCH v2] " Alexey Dobriyan
@ 2008-09-23 20:56                 ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2008-09-23 20:56 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Greg KH, linux-kernel, akpm

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

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

end of thread, other threads:[~2008-09-23 20:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-30  4:42 kobject leak in next-20080829 Alexey Dobriyan
2008-08-30  5:43 ` Greg KH
2008-09-06  5:45   ` kobject leak in next-20080829 (and mainline) Alexey Dobriyan
2008-09-12 15:51     ` Greg KH
2008-09-14  8:42       ` [PATCH] Fix "notes" kobject leak Alexey Dobriyan
2008-09-15 22:53         ` Greg KH
2008-09-15 23:35           ` Alexey Dobriyan
2008-09-15 23:40             ` Greg KH
2008-09-23 19:51               ` [PATCH v2] " Alexey Dobriyan
2008-09-23 20:56                 ` Greg KH

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