public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: wangdich9700@163.com
Cc: johannes@sipsolutions.net, perex@perex.cz, tiwai@suse.com,
	linux-sound@vger.kernel.org, wangdicheng <wangdicheng@kylinos.cn>
Subject: Re: [PATCH 1/2] ALSA: aoa/onyx: Fix OF node leak on probe failure
Date: Thu, 02 Apr 2026 12:43:56 +0200	[thread overview]
Message-ID: <87tsttiqvn.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260402023541.54476-1-wangdich9700@163.com>

On Thu, 02 Apr 2026 04:35:41 +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>
> ---
>  sound/aoa/codecs/onyx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
> index 04961c456d2c..fea12d3a06a9 100644
> --- a/sound/aoa/codecs/onyx.c
> +++ b/sound/aoa/codecs/onyx.c
> @@ -985,6 +985,7 @@ static int onyx_i2c_probe(struct i2c_client *client)
>  	printk(KERN_DEBUG PFX "created and attached onyx instance\n");
>  	return 0;
>   fail:
> +	of_node_put(onyx->codec.node);
>  	kfree(onyx);
>  	return -ENODEV;

This error path is used commonly for the code path before
of_node_get(), hence you can't put of_node_put() unconditionally.

You'll need another goto label for of_node_put() and the error path
from aoa_codec_register() should jump to it.


thanks,

Takashi

      reply	other threads:[~2026-04-02 10:43 UTC|newest]

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

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=87tsttiqvn.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=wangdich9700@163.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