public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: wangdich9700@163.com
To: johannes@sipsolutions.net, perex@perex.cz, tiwai@suse.com,
	wangdich9700@163.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org,
	wangdicheng <wangdicheng@kylinos.cn>
Subject: [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure
Date: Fri,  3 Apr 2026 09:47:36 +0800	[thread overview]
Message-ID: <20260403014736.33014-1-wangdich9700@163.com> (raw)

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



             reply	other threads:[~2026-04-03  2:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  1:47 wangdich9700 [this message]
2026-04-03  8:11 ` [PATCH v2 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403014736.33014-1-wangdich9700@163.com \
    --to=wangdich9700@163.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-sound@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=wangdicheng@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox