X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=samples%2Fkobject%2Fkset-example.c;h=7395c0bbae18426e119d47bb67e59da293228952;hb=2528ce3237be4e900f5eaa455490146e1422e424;hp=b0a1b4fe6584a026866233136d69d19bb3f9d468;hpb=b297d520b9af536d5580ac505dd316be4cf5560c;p=linux-2.6 diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index b0a1b4fe65..7395c0bbae 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; }