public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/13] gpio: arizona: handle pm_runtime_get_sync failure case
@ 2020-07-14 14:39 Sasha Levin
  2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 02/13] gpio: arizona: put pm_runtime in case of failure Sasha Levin
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sasha Levin @ 2020-07-14 14:39 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Navid Emamdoost, Charles Keepax, Linus Walleij, Sasha Levin,
	patches, linux-gpio

From: Navid Emamdoost <navid.emamdoost@gmail.com>

[ Upstream commit e6f390a834b56583e6fc0949822644ce92fbb107 ]

Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count. Call pm_runtime_put if
pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200605025207.65719-1-navid.emamdoost@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-arizona.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index ba51ea15f3794..485aa45fc5d53 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -111,6 +111,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
 		ret = pm_runtime_get_sync(chip->parent);
 		if (ret < 0) {
 			dev_err(chip->parent, "Failed to resume: %d\n", ret);
+			pm_runtime_put(chip->parent);
 			return ret;
 		}
 	}
-- 
2.25.1


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

end of thread, other threads:[~2020-07-14 14:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-14 14:39 [PATCH AUTOSEL 4.19 01/13] gpio: arizona: handle pm_runtime_get_sync failure case Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 02/13] gpio: arizona: put pm_runtime in case of failure Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 03/13] pinctrl: amd: fix npins for uart0 in kerncz_groups Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 04/13] mac80211: allow rx of mesh eapol frames with default rx key Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 05/13] scsi: scsi_transport_spi: Fix function pointer check Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 06/13] xtensa: fix __sync_fetch_and_{and,or}_4 declarations Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 07/13] xtensa: update *pos in cpuinfo_op.next Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 08/13] drivers/net/wan/lapbether: Fixed the value of hard_header_len Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 09/13] ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 10/13] net: usb: qmi_wwan: add support for Quectel EG95 LTE modem Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 11/13] net: sky2: initialize return of gm_phy_read Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 12/13] drm/nouveau/i2c/g94-: increase NV_PMGR_DP_AUXCTL_TRANSACTREQ timeout Sasha Levin
2020-07-14 14:39 ` [PATCH AUTOSEL 4.19 13/13] drivers/firmware/psci: Fix memory leakage in alloc_init_cpu_groups() Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox