From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "David E. Box" <david.e.box@linux.intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/4] iosf_mbi: pci_dev_put() is NULL-proof
Date: Wed, 8 Jul 2015 12:32:51 +0300 [thread overview]
Message-ID: <1436347973-50436-3-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1436347973-50436-1-git-send-email-andriy.shevchenko@linux.intel.com>
No need to check for NULL when call pci_dev_put().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/x86/kernel/iosf_mbi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/iosf_mbi.c b/arch/x86/kernel/iosf_mbi.c
index 2362da9..0b33105 100644
--- a/arch/x86/kernel/iosf_mbi.c
+++ b/arch/x86/kernel/iosf_mbi.c
@@ -314,10 +314,8 @@ static void __exit iosf_mbi_exit(void)
iosf_debugfs_remove();
pci_unregister_driver(&iosf_mbi_pci_driver);
- if (mbi_pdev) {
- pci_dev_put(mbi_pdev);
- mbi_pdev = NULL;
- }
+ pci_dev_put(mbi_pdev);
+ mbi_pdev = NULL;
}
module_init(iosf_mbi_init);
--
2.1.4
next prev parent reply other threads:[~2015-07-08 9:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 9:32 [PATCH v1 0/4] iosf_mbi: clean up Andy Shevchenko
2015-07-08 9:32 ` [PATCH v1 1/4] iosf_mbi: check result for all calls of debugfs API Andy Shevchenko
2015-07-08 9:49 ` Thomas Gleixner
2015-07-08 10:02 ` Andy Shevchenko
2015-07-08 9:32 ` Andy Shevchenko [this message]
2015-07-08 9:32 ` [PATCH v1 3/4] iosf_mbi: group global variables Andy Shevchenko
2015-07-08 9:32 ` [PATCH v1 4/4] iosf_mbi: append Intel Tangier ID Andy Shevchenko
2015-07-08 9:36 ` [PATCH v1 0/4] iosf_mbi: clean up Ingo Molnar
2015-07-08 9:52 ` Thomas Gleixner
2015-07-08 10:00 ` Andy Shevchenko
2015-07-08 10:55 ` Ingo Molnar
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=1436347973-50436-3-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=david.e.box@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=x86@kernel.org \
/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