Linux-NVDIMM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] acpi/nfit: unlock on error in scrub_show()
@ 2019-10-18 12:35 Dan Carpenter
  2019-10-18 16:16 ` Dan Williams
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-10-18 12:35 UTC (permalink / raw)
  To: Dan Williams
  Cc: Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman, linux-nvdimm,
	linux-acpi, linux-kernel, kernel-janitors

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>
---
 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
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi/nfit: unlock on error in scrub_show()
  2019-10-18 12:35 [PATCH] acpi/nfit: unlock on error in scrub_show() Dan Carpenter
@ 2019-10-18 16:16 ` Dan Williams
  2019-10-18 19:12 ` Ira Weiny
  2019-10-20 23:34 ` Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2019-10-18 16:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman, linux-nvdimm,
	Linux ACPI, Linux Kernel Mailing List, kernel-janitors

On Fri, Oct 18, 2019 at 5:37 AM Dan Carpenter <dan.carpenter@oracle.com> 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 <dan.carpenter@oracle.com>

Looks good to me, thanks Dan.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi/nfit: unlock on error in scrub_show()
  2019-10-18 12:35 [PATCH] acpi/nfit: unlock on error in scrub_show() Dan Carpenter
  2019-10-18 16:16 ` Dan Williams
@ 2019-10-18 19:12 ` Ira Weiny
  2019-10-20 23:34 ` Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Ira Weiny @ 2019-10-18 19:12 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman, linux-nvdimm,
	linux-acpi, linux-kernel, kernel-janitors

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 <dan.carpenter@oracle.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  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
> 
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi/nfit: unlock on error in scrub_show()
  2019-10-18 12:35 [PATCH] acpi/nfit: unlock on error in scrub_show() Dan Carpenter
  2019-10-18 16:16 ` Dan Williams
  2019-10-18 19:12 ` Ira Weiny
@ 2019-10-20 23:34 ` Rafael J. Wysocki
  2019-10-21 14:43   ` Dan Williams
  2 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2019-10-20 23:34 UTC (permalink / raw)
  To: Dan Carpenter, Dan Williams
  Cc: Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman, linux-nvdimm,
	ACPI Devel Maling List, Linux Kernel Mailing List,
	kernel-janitors

On Fri, Oct 18, 2019 at 2:38 PM Dan Carpenter <dan.carpenter@oracle.com> 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 <dan.carpenter@oracle.com>
> ---
>  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.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] acpi/nfit: unlock on error in scrub_show()
  2019-10-20 23:34 ` Rafael J. Wysocki
@ 2019-10-21 14:43   ` Dan Williams
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Williams @ 2019-10-21 14:43 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Dan Carpenter, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	linux-nvdimm, ACPI Devel Maling List, Linux Kernel Mailing List,
	kernel-janitors

On Sun, Oct 20, 2019 at 4:35 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Oct 18, 2019 at 2:38 PM Dan Carpenter <dan.carpenter@oracle.com> 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 <dan.carpenter@oracle.com>
> > ---
> >  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 <dan.j.williams@intel.com>
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 12:35 [PATCH] acpi/nfit: unlock on error in scrub_show() Dan Carpenter
2019-10-18 16:16 ` Dan Williams
2019-10-18 19:12 ` Ira Weiny
2019-10-20 23:34 ` Rafael J. Wysocki
2019-10-21 14:43   ` Dan Williams

Linux-NVDIMM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvdimm/0 linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ https://lore.kernel.org/linux-nvdimm \
		linux-nvdimm@lists.01.org
	public-inbox-index linux-nvdimm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.01.lists.linux-nvdimm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git