]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: cs42l43: Fix leaked pm reference on error path
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 8 May 2026 14:34:52 +0000 (15:34 +0100)
committerLinus Walleij <linusw@kernel.org>
Wed, 27 May 2026 12:24:19 +0000 (14:24 +0200)
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>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/cirrus/pinctrl-cs42l43.c

index 227c37c360e19af43fca2b7dc65e3dd7b16cdc37..3cc183520607706bc907acaaac4c1efe84b63251 100644 (file)
@@ -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,