kobject: Restore old behaviour of kobject_del(NULL)
Subsystems (2)
PATCH v2 1/1 kobject: Restore old behaviour of kobject_del(NULL)
The commit 079ad2fb4bf9 ("kobject: Avoid premature parent object freeing in kobject_cleanup()") inadvertently dropped a possibility to call kobject_del() with NULL pointer. Restore the old behaviour.
---
v2: replaced ?: with plain conditional (Greg)
lib/kobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
lib/kobject.c +5 -1
@@ -637,8 +637,12 @@ static void __kobject_del(struct kobject *kobj)*/ void kobject_del (struct kobject *kobj) { -struct kobject *parent = kobj->parent; +struct kobject *parent; + +if (!kobj) +return ; + parent = kobj->parent;__kobject_del (kobj);kobject_put (parent); }
Signature · 1 line
2.27.0
Quoted 6 lines · Andy Shevchenko
The commit
079ad2fb4bf9("kobject: Avoid premature parent object freeing inkobject_cleanup()") inadvertently dropped a possibility to callkobject_del()with NULL pointer. Restore the old behaviour.Fixes 079ad2fb4bf9 ("kobject: Avoid premature parent object freeing in kobject_cleanup()")Reported-by Qu Wenruo <[email protected]>
Sorry, I should use my suse mailbox for that.
Quoted 2 lines
Cc Heikki Krogerus <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Thanks,
Qu
Quoted 24 lines
---
v2: replaced ?: with plain conditional (Greg)lib/kobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)lib/kobject.c +5
-1@@ -637,8 +637,12 @@ static void __kobject_del(struct kobject *kobj)*/ void kobject_del (struct kobject *kobj) { -struct kobject *parent = kobj->parent; +struct kobject *parent; + +if (!kobj) +return ; + parent = kobj->parent;__kobject_del (kobj);kobject_put (parent); }
Greg Kroah-Hartman
maintainerQuoted 4 lines · Andy Shevchenko
The commit
079ad2fb4bf9("kobject: Avoid premature parent object freeing inkobject_cleanup()") inadvertently dropped a possibility to callkobject_del()with NULL pointer. Restore the old behaviour.
Quoted 8 lines
Fixes 079ad2fb4bf9 ("kobject: Avoid premature parent object freeing in kobject_cleanup()")Reported-by Qu Wenruo <[email protected]>Cc Heikki Krogerus <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>---
v2: replaced ?: with plain conditional (Greg)lib/kobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Thanks, much better, will queue up after -rc1 is out.
greg k-h
Quoted 14 lines · Greg Kroah-Hartman
Quoted 4 lines · Andy Shevchenko
The commit
079ad2fb4bf9("kobject: Avoid premature parent object freeing inkobject_cleanup()") inadvertently dropped a possibility to callkobject_del()with NULL pointer. Restore the old behaviour.Quoted 8 lines
Fixes 079ad2fb4bf9 ("kobject: Avoid premature parent object freeing in kobject_cleanup()")Reported-by Qu Wenruo <[email protected]>Cc Heikki Krogerus <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>---
v2: replaced ?: with plain conditional (Greg)lib/kobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 1 line
Thanks, much better, will queue up after -rc1 is out.
Shouldn't be this taken care of?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerQuoted 15 lines · Andy Shevchenko
Quoted 14 lines · Greg Kroah-Hartman
Quoted 12 lines · Andy Shevchenko
The commit
079ad2fb4bf9("kobject: Avoid premature parent object freeing inkobject_cleanup()") inadvertently dropped a possibility to callkobject_del()with NULL pointer. Restore the old behaviour.Fixes 079ad2fb4bf9 ("kobject: Avoid premature parent object freeing in kobject_cleanup()")Reported-by Qu Wenruo <[email protected]>Cc Heikki Krogerus <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>---
v2: replaced ?: with plain conditional (Greg)lib/kobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 3 lines
Quoted 1 line
Thanks, much better, will queue up after -rc1 is out.
Shouldn't be this taken care of?
Yes, will get to it soon, after -rc1 is tough, combined with Plumbers...
greg k-h