From: Akinobu Mita Date: Thu, 26 Apr 2007 07:12:09 +0000 (-0700) Subject: mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure occurs X-Git-Tag: v2.6.22-rc1~1119^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=240936e18b75937e7866934df723c2db0011d24f;p=linux-2.6 mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure 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 Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/module.c b/kernel/module.c index dcdb32b8b1..9da5af668a 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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)