Skip to content

Commit

Permalink
mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure…
Browse files Browse the repository at this point in the history
… occurs

mod_sysfs_setup() doesn't return an errno when kobject_add_dir() for module
"holders" directory fails.  So caller of mod_sysfs_setup() will keep going
and get oops.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Akinobu Mita authored and Greg Kroah-Hartman committed Apr 27, 2007
1 parent a53c46d commit 240936e
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 @@ -1148,8 +1148,10 @@ int mod_sysfs_setup(struct module *mod,
goto out;

mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders");
if (!mod->holders_dir)
if (!mod->holders_dir) {
err = -ENOMEM;
goto out_unreg;
}

err = module_param_sysfs_setup(mod, kparam, num_params);
if (err)
Expand Down

0 comments on commit 240936e

Please sign in to comment.