提交 240936e1 编写于 作者: A Akinobu Mita 提交者: Greg Kroah-Hartman

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: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a53c46dc
...@@ -1148,8 +1148,10 @@ int mod_sysfs_setup(struct module *mod, ...@@ -1148,8 +1148,10 @@ int mod_sysfs_setup(struct module *mod,
goto out; goto out;
mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders"); mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders");
if (!mod->holders_dir) if (!mod->holders_dir) {
err = -ENOMEM;
goto out_unreg; goto out_unreg;
}
err = module_param_sysfs_setup(mod, kparam, num_params); err = module_param_sysfs_setup(mod, kparam, num_params);
if (err) if (err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册