mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Tang Bin <tangbin@cmss.chinamobile.com>,
	srini@kernel.org, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: qcom: storm: Fix of_node_put leak on error path
Date: Tue, 27 Oct 2026 14:07:39 +0000	[thread overview]
Message-ID: <b7fc002c-4c01-43c4-b404-a9599a938fb4@oss.qualcomm.com> (raw)
In-Reply-To: <20261025081610.2675-1-tangbin@cmss.chinamobile.com>

On 10/25/26 8:16 AM, Tang Bin wrote:
> In storm_parse_of(), if the codec phandle is not found, the function
> returns -EINVAL without releasing the CPU phandle that was obtained
> earlier via of_parse_phandle(). Since storm_dai_link is a static struct,
> the leaked reference persists. On a probe retry, the CPU of_node would
> be overwritten by a new of_parse_phandle() call, losing the reference
> to the previous one.
> 
> Fix this by calling of_node_put(dai_link->cpus->of_node) before
> returning -EINVAL when the codec phandle is not found.
> 
> Fixes: 79119c798649 ("ASoC: qcom: Add Storm machine driver")
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---


Reviewed-by: Srinivas Kandagatla<srinivas.kandagatla@oss.qualcomm.com>

--Srini


>  sound/soc/qcom/storm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
> index 6b42fbfd2..6a42876ce 100644
> --- a/sound/soc/qcom/storm.c
> +++ b/sound/soc/qcom/storm.c
> @@ -79,6 +79,7 @@ static int storm_parse_of(struct device *dev)
>  	dai_link->codecs->of_node = of_parse_phandle(np, "codec", 0);
>  	if (!dai_link->codecs->of_node) {
>  		dev_err(dev, "error getting codec phandle\n");
> +		of_node_put(dai_link->cpus->of_node);
>  		return -EINVAL;
>  	}
>  


      reply	other threads:[~2026-10-27 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  8:16 Tang Bin
2026-10-27 14:07 ` Srinivas Kandagatla [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=b7fc002c-4c01-43c4-b404-a9599a938fb4@oss.qualcomm.com \
    --to=srinivas.kandagatla@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srini@kernel.org \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®