From: Wen Yang <wen.yang99@zte.com.cn>
To: lgirdwood@gmail.com
Cc: wang.yi59@zte.com.cn, alsa-devel@alsa-project.org,
timur@kernel.org, Xiubo.Lee@gmail.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
tiwai@suse.com, nicoleotsuka@gmail.com,
Vinod Koul <vkoul@kernel.org>,
broonie@kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
perex@perex.cz, festevam@gmail.com,
Wen Yang <wen.yang99@zte.com.cn>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH 1/3] ASoC: wcd9335: fix a leaked reference by adding missing of_node_put
Date: Tue, 26 Feb 2019 16:17:49 +0800 [thread overview]
Message-ID: <1551169071-11639-1-git-send-email-wen.yang99@zte.com.cn> (raw)
The call to of_parse_phandle returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.
Detected by coccinelle with the following warnings:
./sound/soc/codecs/wcd9335.c:5193:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 5183, but without a correspon ding object release within this function.
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com> (commit_signer:1/11=9%,authored:1/11=9%)
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
---
sound/soc/codecs/wcd9335.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 981f88a..a04a7ce 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -5188,6 +5188,7 @@ static int wcd9335_slim_status(struct slim_device *sdev,
wcd->slim = sdev;
wcd->slim_ifc_dev = of_slim_get_device(sdev->ctrl, ifc_dev_np);
+ of_node_put(ifc_dev_np);
if (!wcd->slim_ifc_dev) {
dev_err(dev, "Unable to get SLIM Interface device\n");
return -EINVAL;
--
2.9.5
next reply other threads:[~2019-02-26 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 8:17 Wen Yang [this message]
2019-02-26 8:17 ` [PATCH 2/3] ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put Wen Yang
2019-04-05 12:30 ` Markus Elfring
2019-02-26 8:17 ` [PATCH 3/3] ASoC: eukrea-tlv320: " Wen Yang
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=1551169071-11639-1-git-send-email-wen.yang99@zte.com.cn \
--to=wen.yang99@zte.com.cn \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=srinivas.kandagatla@linaro.org \
--cc=timur@kernel.org \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=wang.yi59@zte.com.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;
as well as URLs for NNTP newsgroup(s).