aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-09-29 04:58:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:04 -0400
commitd8c7649e99e4b081b624aefe1e77caa30b53cb18 (patch)
tree4afc0411a45521963492a22a6c9712d9b7059bbb /kernel/params.c
parent5906e4171ad61ce68de95e51b773146707671f80 (diff)
[PATCH] kernel/params: driver layer error checking
Check driver layer return values in kernel/params.c Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 91aea7aa532e..63d432d0ebc0 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -547,6 +547,7 @@ static void __init kernel_param_sysfs_setup(const char *name,
547 unsigned int name_skip) 547 unsigned int name_skip)
548{ 548{
549 struct module_kobject *mk; 549 struct module_kobject *mk;
550 int ret;
550 551
551 mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL); 552 mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
552 BUG_ON(!mk); 553 BUG_ON(!mk);
@@ -554,7 +555,8 @@ static void __init kernel_param_sysfs_setup(const char *name,
554 mk->mod = THIS_MODULE; 555 mk->mod = THIS_MODULE;
555 kobj_set_kset_s(mk, module_subsys); 556 kobj_set_kset_s(mk, module_subsys);
556 kobject_set_name(&mk->kobj, name); 557 kobject_set_name(&mk->kobj, name);
557 kobject_register(&mk->kobj); 558 ret = kobject_register(&mk->kobj);
559 BUG_ON(ret < 0);
558 560
559 /* no need to keep the kobject if no parameter is exported */ 561 /* no need to keep the kobject if no parameter is exported */
560 if (!param_sysfs_setup(mk, kparam, num_params, name_skip)) { 562 if (!param_sysfs_setup(mk, kparam, num_params, name_skip)) {
@@ -684,7 +686,14 @@ decl_subsys(module, &module_ktype, NULL);
684 */ 686 */
685static int __init param_sysfs_init(void) 687static int __init param_sysfs_init(void)
686{ 688{
687 subsystem_register(&module_subsys); 689 int ret;
690
691 ret = subsystem_register(&module_subsys);
692 if (ret < 0) {
693 printk(KERN_WARNING "%s (%d): subsystem_register error: %d\n",
694 __FILE__, __LINE__, ret);
695 return ret;
696 }
688 697
689 param_sysfs_builtin(); 698 param_sysfs_builtin();
690 699