Skip to contentSkip to conversation

spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure

PATCH In review Navid Emamdoost 2 participants 2 messages Jun 2, 2020 – Jun 5, 2020

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

PATCH 1/1 spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure

The counter is incremented via pm_runtime_get even in failure case. To correct the counter call pm_runtime_put in case of failure, too.

---
 drivers/spi/spi-tegra20-sflash.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-tegra20-sflash.c +1 -0
index 514429379206..33c34f9c2021 100644
@@ -552,6 +552,7 @@ static int tegra_sflash_resume(struct device *dev)
 
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
+		pm_runtime_put(dev);
 		dev_err(dev, "pm runtime failed, e = %d\n", ret);
 		return ret;
 	}
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 13 lines · Navid Emamdoost

The counter is incremented via pm_runtime_get even in failure case. To correct the counter call pm_runtime_put in case of failure, too.

---
 drivers/spi/spi-tegra20-sflash.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-tegra20-sflash.c +0 -0
index 514429379206..33c34f9c2021 100644

drivers/spi/spi-tegra20-sflash.c static int tegra_sflash_resume(struct device *dev) · line 558

Quoted 7 lines
drivers/spi/spi-tegra20-sflash.c +1 -0
@@ -552,6 +552,7 @@ static int tegra_sflash_resume(struct device *dev)
 
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
+		pm_runtime_put(dev);
 		dev_err(dev, "pm runtime failed, e = %d\n", ret);
 		return ret;
 	}

There is another instance of this in this driver that needs fixing.

Jon

Signature · 1 line
nvpublic