From: Mario Limonciello Date: Mon, 6 Nov 2017 03:34:33 +0000 (-0600) Subject: platform/x86: wmi: release mutex on module acquistion failure X-Git-Tag: v4.19~2100^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e3e22971fb0b0d7d03286f1a619d0348748a243;p=platform%2Fkernel%2Flinux-rpi.git platform/x86: wmi: release mutex on module acquistion failure This failure mode should have also released the mutex. Signed-off-by: Mario Limonciello Signed-off-by: Darren Hart (VMware) --- diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 8c31ed4f..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)