Skip to content

Commit

Permalink
[PATCH] module: fix mod_sysfs_setup() return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Dec 30, 2006
1 parent 96ceeaf commit a3f99f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a3f99f8

Please sign in to comment.