diff options
-rw-r--r-- | kernel/params.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/params.c b/kernel/params.c index 97e092312155..1078b148ca80 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -561,11 +561,9 @@ static void __init kernel_param_sysfs_setup(const char *name, | |||
561 | 561 | ||
562 | mk->mod = THIS_MODULE; | 562 | mk->mod = THIS_MODULE; |
563 | mk->kobj.kset = module_kset; | 563 | mk->kobj.kset = module_kset; |
564 | mk->kobj.ktype = &module_ktype; | 564 | ret = kobject_init_and_add(&mk->kobj, &module_ktype, NULL, "%s", name); |
565 | kobject_set_name(&mk->kobj, name); | ||
566 | kobject_init(&mk->kobj); | ||
567 | ret = kobject_add(&mk->kobj); | ||
568 | if (ret) { | 565 | if (ret) { |
566 | kobject_put(&mk->kobj); | ||
569 | printk(KERN_ERR "Module '%s' failed to be added to sysfs, " | 567 | printk(KERN_ERR "Module '%s' failed to be added to sysfs, " |
570 | "error number %d\n", name, ret); | 568 | "error number %d\n", name, ret); |
571 | printk(KERN_ERR "The system will be unstable now.\n"); | 569 | printk(KERN_ERR "The system will be unstable now.\n"); |