From: Johan Hovold <johan@kernel.org>
To: Srinivas Kandagatla <srini@kernel.org>, Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Subject: [PATCH 2/3] ASoC: codecs: wcd938x: fix OF node leaks on probe failure
Date: Mon, 1 Dec 2025 10:34:18 +0100 [thread overview]
Message-ID: <20251201093419.24474-3-johan@kernel.org> (raw)
In-Reply-To: <20251201093419.24474-1-johan@kernel.org>
The component match entry release function will drop the references
taken while looking up the soundwire OF nodes when the platform device
is unbound.
Drop the additional references taken to avoid leaking them on probe
failure (e.g. probe deferral) and on driver unbind.
Fixes: 8d78602aa87a ("ASoC: codecs: wcd938x: add basic driver")
Cc: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/codecs/wcd938x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index e1a4783b984c..8357f9f1ad72 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -3465,7 +3465,6 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
return -ENODEV;
}
- of_node_get(wcd938x->rxnode);
component_match_add_release(dev, matchptr, component_release_of,
component_compare_of, wcd938x->rxnode);
@@ -3474,7 +3473,7 @@ static int wcd938x_add_slave_components(struct wcd938x_priv *wcd938x,
dev_err(dev, "%s: Tx-device node not defined\n", __func__);
return -ENODEV;
}
- of_node_get(wcd938x->txnode);
+
component_match_add_release(dev, matchptr, component_release_of,
component_compare_of, wcd938x->txnode);
return 0;
--
2.51.2
next prev parent reply other threads:[~2025-12-01 9:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 9:34 [PATCH 0/3] ASoC: codecs: wcd93xx: fix OF node leaks on probe failure Johan Hovold
2025-12-01 9:34 ` [PATCH 1/3] ASoC: codecs: wcd937x: " Johan Hovold
2025-12-01 9:34 ` Johan Hovold [this message]
2025-12-01 9:34 ` [PATCH 3/3] ASoC: codecs: wcd939x: " Johan Hovold
2025-12-01 12:18 ` [PATCH 0/3] ASoC: codecs: wcd93xx: " Srinivas Kandagatla
2025-12-04 13:04 ` Mark Brown
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=20251201093419.24474-3-johan@kernel.org \
--to=johan@kernel.org \
--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=srinivas.kandagatla@oss.qualcomm.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