public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: Sasha Levin <sashal@kernel•org>,
	alsa-devel@alsa-project•org, linuxppc-dev@lists•ozlabs.org,
	Timur Tabi <timur@kernel•org>, Xiubo Li <Xiubo.Lee@gmail•com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	Takashi Iwai <tiwai@suse•com>,
	Liam Girdwood <lgirdwood@gmail•com>,
	stable@vger•kernel.org, Jaroslav Kysela <perex@perex•cz>,
	Nicolin Chen <nicoleotsuka@gmail•com>,
	Mark Brown <broonie@kernel•org>,
	Fabio Estevam <festevam@gmail•com>,
	Wen Yang <wen.yang99@zte•com.cn>
Subject: [PATCH 5.1 275/405] ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put
Date: Wed, 29 May 2019 20:04:33 -0700	[thread overview]
Message-ID: <20190530030554.808270059@linuxfoundation.org> (raw)
In-Reply-To: <20190530030540.291644921@linuxfoundation.org>

[ Upstream commit c705247136a523488eac806bd357c3e5d79a7acd ]

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/fsl/fsl_utils.c:74:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding     object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte•com.cn>
Cc: Timur Tabi <timur@kernel•org>
Cc: Nicolin Chen <nicoleotsuka@gmail•com>
Cc: Xiubo Li <Xiubo.Lee@gmail•com>
Cc: Fabio Estevam <festevam@gmail•com>
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: alsa-devel@alsa-project•org
Cc: linuxppc-dev@lists•ozlabs.org
Cc: linux-kernel@vger•kernel.org
Signed-off-by: Mark Brown <broonie@kernel•org>
Signed-off-by: Sasha Levin <sashal@kernel•org>
---
 sound/soc/fsl/fsl_utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c
index 9981668ab5909..040d06b89f00a 100644
--- a/sound/soc/fsl/fsl_utils.c
+++ b/sound/soc/fsl/fsl_utils.c
@@ -71,6 +71,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
 	iprop = of_get_property(dma_np, "cell-index", NULL);
 	if (!iprop) {
 		of_node_put(dma_np);
+		of_node_put(dma_channel_np);
 		return -EINVAL;
 	}
 	*dma_id = be32_to_cpup(iprop);
-- 
2.20.1




      parent reply	other threads:[~2019-05-30  3:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190530030540.291644921@linuxfoundation.org>
2019-05-30  3:03 ` [PATCH 5.1 226/405] cpufreq/pasemi: fix possible object reference leak Greg Kroah-Hartman
2019-05-30  3:03 ` [PATCH 5.1 227/405] cpufreq: pmac32: " Greg Kroah-Hartman
2019-05-30  3:04 ` Greg Kroah-Hartman [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=20190530030554.808270059@linuxfoundation.org \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=Xiubo.Lee@gmail$(echo .)com \
    --cc=alsa-devel@alsa-project$(echo .)org \
    --cc=broonie@kernel$(echo .)org \
    --cc=festevam@gmail$(echo .)com \
    --cc=lgirdwood@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=nicoleotsuka@gmail$(echo .)com \
    --cc=perex@perex$(echo .)cz \
    --cc=sashal@kernel$(echo .)org \
    --cc=stable@vger$(echo .)kernel.org \
    --cc=timur@kernel$(echo .)org \
    --cc=tiwai@suse$(echo .)com \
    --cc=wen.yang99@zte$(echo .)com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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