Skip to contentSkip to conversation

pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()

PATCH In review Felix Gu 3 participants 3 messages Feb 23 – Feb 24

Subsystems (5)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()

devm_add_action_or_reset() already invokes the action on failure, so the explicit put causes a double-put.

Fixes 9b07cdf86a0b ("pinctrl: cirrus: Fix fwnode leak in cs42l43_pin_probe()")
---
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pinctrl/cirrus/pinctrl-cs42l43.c +2 -3
index a8f82104a384..227c37c360e1 100644
@@ -574,10 +574,9 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
 		if (child) {
 			ret = devm_add_action_or_reset(&pdev->dev,
 				cs42l43_fwnode_put, child);
-			if (ret) {
-				fwnode_handle_put(child);
+			if (ret)
 				return ret;
-			}
+
 			if (!child->dev)
 				child->dev = priv->dev;
 			fwnode = child;

---
base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
change-id: 20260223-cs42-1244548516b0

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
maintainer
#2 lore raw
In reply to Felix Gu
Quoted 5 lines · Felix Gu

devm_add_action_or_reset() already invokes the action on failure, so the explicit put causes a double-put.

Fixes 9b07cdf86a0b ("pinctrl: cirrus: Fix fwnode leak in cs42l43_pin_probe()")

Patch applied for fixes!

Yours,
Linus Walleij