* [PATCH] mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure occurs
@ 2007-04-14 6:08 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2007-04-14 6:08 UTC (permalink / raw)
To: linux-kernel
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>
Index: 2.6-mm/kernel/module.c
===================================================================
--- 2.6-mm.orig/kernel/module.c
+++ 2.6-mm/kernel/module.c
@@ -1423,8 +1423,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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-14 6:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-14 6:08 [PATCH] mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure occurs Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox