projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a231934
)
kobject: should use kobject_put() in kset-example
author
Li Zefan
<lizf@cn.fujitsu.com>
Fri, 13 Jun 2008 03:09:16 +0000
(11:09 +0800)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 22 Jul 2008 04:54:56 +0000
(21:54 -0700)
We should call kobject_put() instead of kfree() if kobject_init_and_add()
returns an error, shouldn't we? Don't set up a bad example ;)
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
samples/kobject/kset-example.c
patch
|
blob
|
blame
|
history
diff --git
a/samples/kobject/kset-example.c
b/samples/kobject/kset-example.c
index b0a1b4fe6584a026866233136d69d19bb3f9d468..7395c0bbae18426e119d47bb67e59da293228952 100644
(file)
--- a/
samples/kobject/kset-example.c
+++ b/
samples/kobject/kset-example.c
@@
-211,7
+211,7
@@
static struct foo_obj *create_foo_obj(const char *name)
*/
retval = kobject_init_and_add(&foo->kobj, &foo_ktype, NULL, "%s", name);
if (retval) {
- k
free(foo
);
+ k
object_put(&foo->kobj
);
return NULL;
}