From: tip-bot for Andy Shevchenko <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/platform] x86/platform/iosf_mbi: Check return value of debugfs_create properly
Date: Thu, 16 Jul 2015 08:52:44 -0700 [thread overview]
Message-ID: <tip-64279c7e05264f9774c6c9ee65a5b9ed186e442b@git.kernel.org> (raw)
In-Reply-To: <1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com>
Commit-ID: 64279c7e05264f9774c6c9ee65a5b9ed186e442b
Gitweb: http://git.kernel.org/tip/64279c7e05264f9774c6c9ee65a5b9ed186e442b
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Wed, 8 Jul 2015 17:45:06 +0300
Committer: Thomas Gleixner <tglx@linutronix.de>
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 <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>
---
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;
next prev parent reply other threads:[~2015-07-16 15:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 14:45 [PATCH v2 0/5] x86/platform/iosf_mbi: fix and clean up Andy Shevchenko
2015-07-08 14:45 ` [PATCH v2 1/5] x86/platform/iosf_mbi: move to dedicated folder Andy Shevchenko
2015-07-16 15:52 ` [tip:x86/platform] x86/platform/iosf_mbi: Move " tip-bot for Andy Shevchenko
2015-07-08 14:45 ` [PATCH v2 2/5] x86/platform/iosf_mbi: check result for all calls of debugfs API Andy Shevchenko
2015-07-16 15:52 ` tip-bot for Andy Shevchenko [this message]
2015-07-08 14:45 ` [PATCH v2 3/5] x86/platform/iosf_mbi: pci_dev_put() is NULL-proof Andy Shevchenko
2015-07-16 15:53 ` [tip:x86/platform] x86/platform/iosf_mbi: Remove NULL pointer checks for pci_dev_put() tip-bot for Andy Shevchenko
2015-07-08 14:45 ` [PATCH v2 4/5] x86/platform/iosf_mbi: group global variables Andy Shevchenko
2015-07-16 15:53 ` [tip:x86/platform] x86/platform/iosf_mbi: Source cleanup tip-bot for Andy Shevchenko
2015-07-08 14:45 ` [PATCH v2 5/5] x86/platform/iosf_mbi: append Intel Tangier ID Andy Shevchenko
2015-07-16 15:42 ` Thomas Gleixner
2015-07-16 15:53 ` [tip:x86/platform] x86/platform/iosf_mbi: Add Intel Tangier PCI id tip-bot for Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-64279c7e05264f9774c6c9ee65a5b9ed186e442b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=david.e.box@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®