From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755973AbbGPPw7 (ORCPT ); Thu, 16 Jul 2015 11:52:59 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39106 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755713AbbGPPw4 (ORCPT ); Thu, 16 Jul 2015 11:52:56 -0400 Date: Thu, 16 Jul 2015 08:52:44 -0700 From: tip-bot for Andy Shevchenko Message-ID: Cc: tglx@linutronix.de, david.e.box@linux.intel.com, andriy.shevchenko@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: hpa@zytor.com, andriy.shevchenko@linux.intel.com, david.e.box@linux.intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com> References: <1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] x86/platform/iosf_mbi: Check return value of debugfs_create properly Git-Commit-ID: 64279c7e05264f9774c6c9ee65a5b9ed186e442b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 64279c7e05264f9774c6c9ee65a5b9ed186e442b Gitweb: http://git.kernel.org/tip/64279c7e05264f9774c6c9ee65a5b9ed186e442b Author: Andy Shevchenko AuthorDate: Wed, 8 Jul 2015 17:45:06 +0300 Committer: Thomas Gleixner CommitDate: Thu, 16 Jul 2015 17:48:48 +0200 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 Cc: David E . Box Link: http://lkml.kernel.org/r/1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner --- arch/x86/platform/intel/iosf_mbi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/platform/intel/iosf_mbi.c b/arch/x86/platform/intel/iosf_mbi.c index 82f8d02..2362da9 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) /* mdr */ d = debugfs_create_x32("mdr", 0660, iosf_dbg, &dbg_mdr); - if (IS_ERR_OR_NULL(d)) + if (!d) goto cleanup; /* 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; /* 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; return;