Skip to contentSkip to conversation

acpi/nfit: unlock on error in scrub_show()

PATCH In review Dan Carpenter 4 participants 5 messages Oct 18, 2019 – Oct 21, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/nfit: unlock on error in scrub_show()

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")
---
 drivers/acpi/nfit/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +1 -1
index 1413324982f0..14e68f202f81 100644
@@ -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);
Signature · 1 line
2.20.1
#1 lore raw
Quoted 6 lines · Dan Carpenter

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")

Looks good to me, thanks Dan.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

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")
Quoted 20 lines
---
 drivers/acpi/nfit/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +1 -1
index 1413324982f0..14e68f202f81 100644
@@ -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);
Signature · 1 line
2.20.1
#3 lore raw
In reply to Dan Carpenter
Quoted 15 lines · Dan Carpenter

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")
---
 drivers/acpi/nfit/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +0 -0
index 1413324982f0..14e68f202f81 100644

drivers/acpi/nfit/core.c static ssize_t scrub_show(struct device *dev,

Quoted 9 lines
drivers/acpi/nfit/core.c +1 -2
@@ -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);
--

Applying as a fix for 5.4, thanks!

@Dan W: Please let me know if you'd rather take it yourself.

Acked-by
#4 lore raw
Quoted 29 lines · Rafael J. Wysocki
Quoted 15 lines · Dan Carpenter

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")
---
 drivers/acpi/nfit/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +0 -0
index 1413324982f0..14e68f202f81 100644

drivers/acpi/nfit/core.c static ssize_t scrub_show(struct device *dev,

Quoted 9 lines
drivers/acpi/nfit/core.c +1 -2
@@ -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);
--

Applying as a fix for 5.4, thanks!

Quoted 1 line

@Dan W: Please let me know if you'd rather take it yourself.

If you already have it applied, I have no concerns.