public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure
@ 2026-04-03  1:47 wangdich9700
  2026-04-03  8:11 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: wangdich9700 @ 2026-04-03  1:47 UTC (permalink / raw)
  To: johannes, perex, tiwai, wangdich9700
  Cc: linuxppc-dev, linux-sound, wangdicheng

From: wangdicheng <wangdicheng@kylinos.cn>

Add missing of_node_put() in the error path.

Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
---

v1->v2:
onyx_read_register()--->goto fail--->kfree
aoa_codec_register()--->goto fail_put--->of_node_put + kfree

 sound/aoa/codecs/onyx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
index 04961c456d2c..da0eebf5dfbc 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -980,10 +980,12 @@ static int onyx_i2c_probe(struct i2c_client *client)
 	onyx->codec.node = of_node_get(node);
 
 	if (aoa_codec_register(&onyx->codec)) {
-		goto fail;
+		goto fail_put;
 	}
 	printk(KERN_DEBUG PFX "created and attached onyx instance\n");
 	return 0;
+ fail_put:
+	of_node_put(onyx->codec.node);
  fail:
 	kfree(onyx);
 	return -ENODEV;
-- 
2.25.1



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

* Re: [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure
  2026-04-03  1:47 [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure wangdich9700
@ 2026-04-03  8:11 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-04-03  8:11 UTC (permalink / raw)
  To: wangdich9700
  Cc: johannes, perex, tiwai, linuxppc-dev, linux-sound, wangdicheng

On Fri, 03 Apr 2026 03:47:36 +0200,
wangdich9700@163.com wrote:
> 
> From: wangdicheng <wangdicheng@kylinos.cn>
> 
> Add missing of_node_put() in the error path.
> 
> Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>

Applied to for-next branch now.


thanks,

Takashi


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

end of thread, other threads:[~2026-04-03  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  1:47 [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure wangdich9700
2026-04-03  8:11 ` Takashi Iwai

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