ACPI: NFIT: Fix unlock on error in scrub_show()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 18 Oct 2019 12:35:34 +0000 (15:35 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Oct 2019 09:37:13 +0000 (11:37 +0200)
We change the locking in this function and forgot to update this error
path so we are accidentally still holding the "dev->lockdep_mutex".

Fixes: 87a30e1f05d7 ("driver-core, libnvdimm: Let device subsystems add local lockdep coverage")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Cc: 5.3+ <stable@vger.kernel.org> # 5.3+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/nfit/core.c

index 1413324982f0d7628068711e61e598093b88d320..14e68f202f8109dfce44d19eee7274d68d1552bc 100644 (file)
@@ -1322,7 +1322,7 @@ static ssize_t scrub_show(struct device *dev,
        nfit_device_lock(dev);
        nd_desc = dev_get_drvdata(dev);
        if (!nd_desc) {
-               device_unlock(dev);
+               nfit_device_unlock(dev);
                return rc;
        }
        acpi_desc = to_acpi_desc(nd_desc);