浏览代码

nfit: acpi_nfit_notify(): Do not leave device locked

Even if dev->driver is null because we are being removed,
it is safer to not leave device locked.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Alexey Khoroshilov 9 年之前
父节点
当前提交
d91e892825
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/acpi/nfit.c

+ 1 - 1
drivers/acpi/nfit.c

@@ -1810,7 +1810,7 @@ static void acpi_nfit_notify(struct acpi_device *adev, u32 event)
 	if (!dev->driver) {
 	if (!dev->driver) {
 		/* dev->driver may be null if we're being removed */
 		/* dev->driver may be null if we're being removed */
 		dev_dbg(dev, "%s: no driver found for dev\n", __func__);
 		dev_dbg(dev, "%s: no driver found for dev\n", __func__);
-		return;
+		goto out_unlock;
 	}
 	}
 
 
 	if (!acpi_desc) {
 	if (!acpi_desc) {