kobject: should use kobject_put() in kset-example
[pandora-kernel.git] / samples / kobject / kset-example.c
index b0a1b4f..7395c0b 100644 (file)
@@ -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;
        }