Skip to contentSkip to conversation

kernel: return actual error on param_sysfs_init

PATCH Applied Jeff Liu 2 participants 2 messages Jun 17, 2014

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 7/24 kernel: return actual error on param_sysfs_init

From: Jie Liu <[email protected]>

Return the actual error code if kset_create_and_add() failed

Cc Andrew Morton <[email protected]>
Cc Christoph Lameter <[email protected]>
---
 kernel/params.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
kernel/params.c +3 -4
index 1e52ca2..a110987 100644
@@ -928,10 +928,9 @@ struct kobj_type module_ktype = {
 static int __init param_sysfs_init(void)
 {
 	module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
-	if (!module_kset) {
-		printk(KERN_WARNING "%s (%d): error creating kset\n",
-			__FILE__, __LINE__);
-		return -ENOMEM;
+	if (IS_ERR(module_kset)) {
+		pr_warn("%s (%d): error creating kset\n", __FILE__, __LINE__);
+		return PTR_ERR(module_kset);
 	}
 	module_sysfs_initialized = 1;
 
Signature · 1 line
1.8.3.2