All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] platform/x86: wmi: Fix missing unlock on error in wmi_ioctl()
@ 2017-11-14  6:57 Wei Yongjun
  2017-11-14 14:51 ` Mario.Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2017-11-14  6:57 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Mario Limonciello
  Cc: Wei Yongjun, platform-driver-x86

Add the missing unlock before return from function wmi_ioctl()
in the error handling case.

Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH -next] platform/x86: wmi: Fix missing unlock on error in wmi_ioctl()
  2017-11-14  6:57 [PATCH -next] platform/x86: wmi: Fix missing unlock on error in wmi_ioctl() Wei Yongjun
@ 2017-11-14 14:51 ` Mario.Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario.Limonciello @ 2017-11-14 14:51 UTC (permalink / raw)
  To: weiyongjun1, dvhart, andy; +Cc: platform-driver-x86



> -----Original Message-----
> From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver-x86-
> owner@vger.kernel.org] On Behalf Of Wei Yongjun
> Sent: Tuesday, November 14, 2017 12:58 AM
> To: Darren Hart <dvhart@infradead.org>; Andy Shevchenko
> <andy@infradead.org>; Limonciello, Mario <Mario_Limonciello@Dell.com>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; platform-driver-
> x86@vger.kernel.org
> Subject: [PATCH -next] platform/x86: wmi: Fix missing unlock on error in
> wmi_ioctl()
> 
> Add the missing unlock before return from function wmi_ioctl()
> in the error handling case.
> 
> Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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)

Thanks Wei,

This is already fixed in -next: 
http://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git/commit/5e3e22971fb0b0d7d03286f1a619d0348748a243

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-14 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14  6:57 [PATCH -next] platform/x86: wmi: Fix missing unlock on error in wmi_ioctl() Wei Yongjun
2017-11-14 14:51 ` Mario.Limonciello

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.