瀏覽代碼

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>
Mario Limonciello 7 年之前
父節點
當前提交
5e3e22971f
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/platform/x86/wmi.c

+ 4 - 2
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)