The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: cs42l43: Fix leaked pm reference on error path
@ 2026-05-08 14:34 Charles Keepax
  2026-05-08 14:34 ` [PATCH 2/2] pinctrl: cs42l43: Fix polarity on debounce Charles Keepax
  2026-05-11 12:35 ` [PATCH 1/2] pinctrl: cs42l43: Fix leaked pm reference on error path Bartosz Golaszewski
  0 siblings, 2 replies; 4+ messages in thread
From: Charles Keepax @ 2026-05-08 14:34 UTC (permalink / raw)
  To: linusw; +Cc: brgl, linux-gpio, linux-kernel, patches

Returning directly if the regmap_update_bits() fails causes a pm runtime
reference to be leaked, let things run to the end of the function
instead.

Fixes: e52c741907fb ("pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index 227c37c360e19..3cc1835206077 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -499,12 +499,10 @@ static int cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset,
 
 	ret = regmap_update_bits(priv->regmap, CS42L43_GPIO_CTRL1,
 				 BIT(shift), value << shift);
-	if (ret)
-		return ret;
 
 	pm_runtime_put(priv->dev);
 
-	return 0;
+	return ret;
 }
 
 static int cs42l43_gpio_direction_out(struct gpio_chip *chip,
-- 
2.47.3


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

end of thread, other threads:[~2026-05-11 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 14:34 [PATCH 1/2] pinctrl: cs42l43: Fix leaked pm reference on error path Charles Keepax
2026-05-08 14:34 ` [PATCH 2/2] pinctrl: cs42l43: Fix polarity on debounce Charles Keepax
2026-05-11 12:35   ` Bartosz Golaszewski
2026-05-11 12:35 ` [PATCH 1/2] pinctrl: cs42l43: Fix leaked pm reference on error path Bartosz Golaszewski

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