diff options
author | Mario Limonciello <mario.limonciello@dell.com> | 2017-11-05 21:34:33 -0600 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2017-11-08 12:58:36 -0800 |
commit | 5e3e22971fb0b0d7d03286f1a619d0348748a243 (patch) | |
tree | 29588b56f3ef958afd3e54e69068d24a2a715362 /drivers/platform/x86/wmi.c | |
parent | 54d11736ec3179954b6cdea4b4e1136d6bb39f39 (diff) | |
download | blackbird-op-linux-5e3e22971fb0b0d7d03286f1a619d0348748a243.tar.gz blackbird-op-linux-5e3e22971fb0b0d7d03286f1a619d0348748a243.zip |
platform/x86: wmi: release mutex on module acquistion failure
This failure mode should have also released the mutex.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r-- | drivers/platform/x86/wmi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 8c31ed4f0e1b..791449a2370f 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) |