瀏覽代碼

x86/platform/iosf_mbi: Check return value of debugfs_create properly

The code checks the result of the first debugfs_create call several
times and fails to check the result of the subsequent calls due to
missing assigments.

Add the missing assignments and check only for !res because
debugfs_create() returns only NULL on error and not an encoded error
code.

[ tglx: Massaged changelog ]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: David E . Box <david.e.box@linux.intel.com>
Link: http://lkml.kernel.org/r/1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Andy Shevchenko 10 年之前
父節點
當前提交
64279c7e05
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      arch/x86/platform/intel/iosf_mbi.c

+ 5 - 5
arch/x86/platform/intel/iosf_mbi.c

@@ -240,17 +240,17 @@ static void iosf_sideband_debug_init(void)
 
 
 	/* mdr */
 	/* mdr */
 	d = debugfs_create_x32("mdr", 0660, iosf_dbg, &dbg_mdr);
 	d = debugfs_create_x32("mdr", 0660, iosf_dbg, &dbg_mdr);
-	if (IS_ERR_OR_NULL(d))
+	if (!d)
 		goto cleanup;
 		goto cleanup;
 
 
 	/* mcrx */
 	/* mcrx */
-	debugfs_create_x32("mcrx", 0660, iosf_dbg, &dbg_mcrx);
-	if (IS_ERR_OR_NULL(d))
+	d = debugfs_create_x32("mcrx", 0660, iosf_dbg, &dbg_mcrx);
+	if (!d)
 		goto cleanup;
 		goto cleanup;
 
 
 	/* mcr - initiates mailbox tranaction */
 	/* mcr - initiates mailbox tranaction */
-	debugfs_create_file("mcr", 0660, iosf_dbg, &dbg_mcr, &iosf_mcr_fops);
-	if (IS_ERR_OR_NULL(d))
+	d = debugfs_create_file("mcr", 0660, iosf_dbg, &dbg_mcr, &iosf_mcr_fops);
+	if (!d)
 		goto cleanup;
 		goto cleanup;
 
 
 	return;
 	return;