All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: wmi: Unlock on error in wmi_ioctl()
@ 2017-11-13 10:06 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2017-11-13 10:06 UTC (permalink / raw)
  To: Darren Hart, Mario Limonciello
  Cc: Andy Shevchenko, platform-driver-x86, kernel-janitors

We need to drop a lock if try_module_get() fails.

Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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)

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

end of thread, other threads:[~2017-11-13 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 10:06 [PATCH] platform/x86: wmi: Unlock on error in wmi_ioctl() Dan Carpenter
2017-11-13 10:06 ` Dan Carpenter
2017-11-13 14:51 ` Mario.Limonciello
2017-11-13 17:21   ` Darren Hart
2017-11-13 17:21     ` Darren Hart

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.