[PATCH] module: fix mod_sysfs_setup() return value
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 30 Dec 2006 00:48:20 +0000 (16:48 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Sat, 30 Dec 2006 18:56:41 +0000 (10:56 -0800)
mod_sysfs_setup() doesn't return error when kobject_add_dir() failed.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/module.c

index b565eaeff7e6d73ffcd94d6f531ed3df8fd1b041..dbce132b354c9d9b89f9c8e957f7af6f729c1952 100644 (file)
@@ -1132,8 +1132,10 @@ static int mod_sysfs_setup(struct module *mod,
                goto out;
 
        mod->drivers_dir = kobject_add_dir(&mod->mkobj.kobj, "drivers");
-       if (!mod->drivers_dir)
+       if (!mod->drivers_dir) {
+               err = -ENOMEM;
                goto out_unreg;
+       }
 
        err = module_param_sysfs_setup(mod, kparam, num_params);
        if (err)