2019-10-19 08:24:09

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] 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")
Signed-off-by: Dan Carpenter <[email protected]>
---
drivers/acpi/nfit/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 1413324982f0..14e68f202f81 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -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);
--
2.20.1


2019-10-19 08:40:58

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] acpi/nfit: unlock on error in scrub_show()

On Fri, Oct 18, 2019 at 5:37 AM Dan Carpenter <[email protected]> wrote:
>
> 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 <[email protected]>

Looks good to me, thanks Dan.

2019-10-19 09:10:42

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH] acpi/nfit: unlock on error in scrub_show()

On Fri, Oct 18, 2019 at 03:35:34PM +0300, Dan Carpenter wrote:
> 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 <[email protected]>

Reviewed-by: Ira Weiny <[email protected]>

> ---
> drivers/acpi/nfit/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 1413324982f0..14e68f202f81 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -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);
> --
> 2.20.1
>

2019-10-20 23:35:47

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] acpi/nfit: unlock on error in scrub_show()

On Fri, Oct 18, 2019 at 2:38 PM Dan Carpenter <[email protected]> wrote:
>
> 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 <[email protected]>
> ---
> drivers/acpi/nfit/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 1413324982f0..14e68f202f81 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -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.

2019-10-21 14:44:03

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] acpi/nfit: unlock on error in scrub_show()

On Sun, Oct 20, 2019 at 4:35 PM Rafael J. Wysocki <[email protected]> wrote:
>
> On Fri, Oct 18, 2019 at 2:38 PM Dan Carpenter <[email protected]> wrote:
> >
> > 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 <[email protected]>
> > ---
> > drivers/acpi/nfit/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> > index 1413324982f0..14e68f202f81 100644
> > --- a/drivers/acpi/nfit/core.c
> > +++ b/drivers/acpi/nfit/core.c
> > @@ -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.

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

Acked-by: Dan Williams <[email protected]>