summaryrefslogtreecommitdiffstats
path: root/samples/kobject/kset-example.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/kobject/kset-example.c')
-rw-r--r--samples/kobject/kset-example.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index b0a1b4fe658..7395c0bbae1 100644
--- 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) {
- kfree(foo);
+ kobject_put(&foo->kobj);
return NULL;
}