From: Mario Limonciello <mario.limonciello@dell.com>
To: dvhart@infradead.org, Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
Mario Limonciello <mario.limonciello@dell.com>
Subject: [PATCH 1/2] platform/x86: wmi: release mutex on module acquistion failure
Date: Sun, 5 Nov 2017 21:34:33 -0600 [thread overview]
Message-ID: <1509939274-2813-2-git-send-email-mario.limonciello@dell.com> (raw)
In-Reply-To: <1509939274-2813-1-git-send-email-mario.limonciello@dell.com>
This failure mode should have also released the mutex.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
drivers/platform/x86/wmi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 8c31ed4..791449a 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -868,8 +868,10 @@ static long wmi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/* let the driver do any filtering and do the call */
wdriver = container_of(wblock->dev.dev.driver,
struct wmi_driver, driver);
- if (!try_module_get(wdriver->driver.owner))
- return -EBUSY;
+ if (!try_module_get(wdriver->driver.owner)) {
+ ret = -EBUSY;
+ goto out_ioctl;
+ }
ret = wdriver->filter_callback(&wblock->dev, cmd, buf);
module_put(wdriver->driver.owner);
if (ret)
--
2.7.4
next prev parent reply other threads:[~2017-11-06 3:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 3:34 [PATCH 0/2] Correct some errors caught by buildbot Mario Limonciello
2017-11-06 3:34 ` Mario Limonciello [this message]
2017-11-06 3:34 ` [PATCH 2/2] platform/x86: dell-smbios-wmi: release mutex lock on WMI call failure Mario Limonciello
2017-11-08 20:56 ` [PATCH 0/2] Correct some errors caught by buildbot Darren Hart
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=1509939274-2813-2-git-send-email-mario.limonciello@dell.com \
--to=mario.limonciello@dell.com \
--cc=andy.shevchenko@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.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
all inboxes | Powered by JetHome®