aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-07-08 10:45:06 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-07-16 11:48:48 -0400
commit64279c7e05264f9774c6c9ee65a5b9ed186e442b (patch)
tree6cb11a74346063ffdcb76f06e3eb71ec5d5e1126
parent23ae2a16bb39d999892a86a65933fe3e9b6b525f (diff)
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>
-rw-r--r--arch/x86/platform/intel/iosf_mbi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/platform/intel/iosf_mbi.c b/arch/x86/platform/intel/iosf_mbi.c
index 82f8d02f0df2..2362da912414 100644
--- a/arch/x86/platform/intel/iosf_mbi.c
+++ b/arch/x86/platform/intel/iosf_mbi.c
@@ -240,17 +240,17 @@ static void iosf_sideband_debug_init(void)
240 240
241 /* mdr */ 241 /* mdr */
242 d = debugfs_create_x32("mdr", 0660, iosf_dbg, &dbg_mdr); 242 d = debugfs_create_x32("mdr", 0660, iosf_dbg, &dbg_mdr);
243 if (IS_ERR_OR_NULL(d)) 243 if (!d)
244 goto cleanup; 244 goto cleanup;
245 245
246 /* mcrx */ 246 /* mcrx */
247 debugfs_create_x32("mcrx", 0660, iosf_dbg, &dbg_mcrx); 247 d = debugfs_create_x32("mcrx", 0660, iosf_dbg, &dbg_mcrx);
248 if (IS_ERR_OR_NULL(d)) 248 if (!d)
249 goto cleanup; 249 goto cleanup;
250 250
251 /* mcr - initiates mailbox tranaction */ 251 /* mcr - initiates mailbox tranaction */
252 debugfs_create_file("mcr", 0660, iosf_dbg, &dbg_mcr, &iosf_mcr_fops); 252 d = debugfs_create_file("mcr", 0660, iosf_dbg, &dbg_mcr, &iosf_mcr_fops);
253 if (IS_ERR_OR_NULL(d)) 253 if (!d)
254 goto cleanup; 254 goto cleanup;
255 255
256 return; 256 return;