mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
@ 2026-02-23  9:39 Felix Gu
  2026-02-23 10:08 ` Charles Keepax
  2026-02-24  9:29 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Gu @ 2026-02-23  9:39 UTC (permalink / raw)
  To: David Rhodes, Richard Fitzgerald, Charles Keepax, Linus Walleij,
	Haotian Zhang
  Cc: linux-sound, patches, linux-gpio, linux-kernel, 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()")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index a8f82104a384..227c37c360e1 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -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,
-- 
Felix Gu <ustc.gu@gmail.com>


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

* Re: [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
  2026-02-23  9:39 [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Felix Gu
@ 2026-02-23 10:08 ` Charles Keepax
  2026-02-24  9:29 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-02-23 10:08 UTC (permalink / raw)
  To: Felix Gu
  Cc: David Rhodes, Richard Fitzgerald, Linus Walleij, Haotian Zhang,
	linux-sound, patches, linux-gpio, linux-kernel

On Mon, Feb 23, 2026 at 05:39:07PM +0800, Felix Gu wrote:
> 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()")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
  2026-02-23  9:39 [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Felix Gu
  2026-02-23 10:08 ` Charles Keepax
@ 2026-02-24  9:29 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2026-02-24  9:29 UTC (permalink / raw)
  To: Felix Gu
  Cc: David Rhodes, Richard Fitzgerald, Charles Keepax, Haotian Zhang,
	linux-sound, patches, linux-gpio, linux-kernel

On Mon, Feb 23, 2026 at 10:39 AM Felix Gu <ustc.gu@gmail.com> wrote:

> 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()")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>

Patch applied for fixes!

Yours,
Linus Walleij

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

end of thread, other threads:[~2026-02-24  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-23  9:39 [PATCH] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Felix Gu
2026-02-23 10:08 ` Charles Keepax
2026-02-24  9:29 ` Linus Walleij

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

all inboxes | Powered by JetHome®