From: Akinobu Mita Date: Sat, 30 Dec 2006 00:48:20 +0000 (-0800) Subject: [PATCH] module: fix mod_sysfs_setup() return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a3f99f8ba8cbd2d4e231b767b3d6236a555da38c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] module: fix mod_sysfs_setup() return value mod_sysfs_setup() doesn't return error when kobject_add_dir() failed. Signed-off-by: Akinobu Mita Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/module.c b/kernel/module.c index b565eaeff7e6..dbce132b354c 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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)