All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: tegra20-slink: add missing pm_runtime_put if pm_runtime_get_sync fails
@ 2020-06-02  5:24 ` Navid Emamdoost
  0 siblings, 0 replies; 2+ messages in thread
From: Navid Emamdoost @ 2020-06-02  5:24 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
	smccaman-OJFnDUYgAso, Navid Emamdoost

Call to pm_runtime_get_sync increments counter even in case of
failure leading to incorrect ref count.
Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/spi/spi-tegra20-slink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 7f4d932dade7..9509b7cb14e4 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -756,6 +756,7 @@ static int tegra_slink_setup(struct spi_device *spi)
 	ret = pm_runtime_get_sync(tspi->dev);
 	if (ret < 0) {
 		dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret);
+		pm_runtime_put(tspi->dev);
 		return ret;
 	}
 
-- 
2.17.1

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

* [PATCH] spi: tegra20-slink: add missing pm_runtime_put if pm_runtime_get_sync fails
@ 2020-06-02  5:24 ` Navid Emamdoost
  0 siblings, 0 replies; 2+ messages in thread
From: Navid Emamdoost @ 2020-06-02  5:24 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	linux-spi, linux-tegra, linux-kernel
  Cc: emamd001, wu000273, kjlu, smccaman, Navid Emamdoost

Call to pm_runtime_get_sync increments counter even in case of
failure leading to incorrect ref count.
Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/spi/spi-tegra20-slink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 7f4d932dade7..9509b7cb14e4 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -756,6 +756,7 @@ static int tegra_slink_setup(struct spi_device *spi)
 	ret = pm_runtime_get_sync(tspi->dev);
 	if (ret < 0) {
 		dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret);
+		pm_runtime_put(tspi->dev);
 		return ret;
 	}
 
-- 
2.17.1


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

end of thread, other threads:[~2020-06-02  5:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  5:24 [PATCH] spi: tegra20-slink: add missing pm_runtime_put if pm_runtime_get_sync fails Navid Emamdoost
2020-06-02  5:24 ` Navid Emamdoost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.