提交 a3f99f8b 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

[PATCH] module: fix mod_sysfs_setup() return value

mod_sysfs_setup() doesn't return error when kobject_add_dir() failed.
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 96ceeaf4
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册