Skip to content
Snippets Groups Projects
Commit 70e16a62 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

kobject: clean up the kobject add documentation a bit more


Commit 1fd7c3b4 ("kobject: Improve doc clarity kobject_init_and_add()")
tried to provide more clarity, but the reference to kobject_del() was
incorrect.  Fix that up by removing that line, and hopefully be more explicit
as to exactly what needs to happen here once you register a kobject with the
kobject core.

Acked-by: default avatarTobin C. Harding <tobin@kernel.org>
Fixes: 1fd7c3b4 ("kobject: Improve doc clarity kobject_init_and_add()")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ed856349
No related branches found
No related tags found
No related merge requests found
...@@ -416,8 +416,12 @@ static __printf(3, 0) int kobject_add_varg(struct kobject *kobj, ...@@ -416,8 +416,12 @@ static __printf(3, 0) int kobject_add_varg(struct kobject *kobj,
* to this function be directly freed with a call to kfree(), * to this function be directly freed with a call to kfree(),
* that can leak memory. * that can leak memory.
* *
* If this call returns successfully and you later need to unwind * If this function returns success, kobject_put() must also be called
* kobject_add() for the error path you should call kobject_del(). * in order to properly clean up the memory associated with the object.
*
* In short, once this function is called, kobject_put() MUST be called
* when the use of the object is finished in order to properly free
* everything.
*/ */
int kobject_add(struct kobject *kobj, struct kobject *parent, int kobject_add(struct kobject *kobj, struct kobject *parent,
const char *fmt, ...) const char *fmt, ...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment