X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=samples%2Fkobject%2Fkset-example.c;h=45b7d56fb54185d2008814ec6f4dfff4b42a2e11;hb=7ec7fb394298c212c30e063c57e0aa895efe9439;hp=b0a1b4fe6584a026866233136d69d19bb3f9d468;hpb=6208e77e7fa9e69f399fddc55b1cf9527fbde599;p=linux-2.6-omap-h63xx.git diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index b0a1b4fe658..45b7d56fb54 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; } @@ -229,7 +229,7 @@ static void destroy_foo_obj(struct foo_obj *foo) kobject_put(&foo->kobj); } -static int example_init(void) +static int __init example_init(void) { /* * Create a kset with the name of "kset_example", @@ -264,7 +264,7 @@ foo_error: return -EINVAL; } -static void example_exit(void) +static void __exit example_exit(void) { destroy_foo_obj(baz_obj); destroy_foo_obj(bar_obj);