]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/asoc-fsl_utils-fix-a-leaked-reference-by-adding-miss.patch
drop rdma-cma-consider-scope_id-while-binding-to-ipv6-ll-.patch from 4.4, 4.9, and...
[thirdparty/kernel/stable-queue.git] / queue-4.4 / asoc-fsl_utils-fix-a-leaked-reference-by-adding-miss.patch
CommitLineData
1143c684
SL
1From ef65a84f40cbd4d57520c34cb9467dc58ea9b930 Mon Sep 17 00:00:00 2001
2From: Wen Yang <wen.yang99@zte.com.cn>
3Date: Tue, 26 Feb 2019 16:17:50 +0800
4Subject: ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put
5
6[ Upstream commit c705247136a523488eac806bd357c3e5d79a7acd ]
7
8The call to of_parse_phandle returns a node pointer with refcount
9incremented thus it must be explicitly decremented after the last
10usage.
11
12Detected by coccinelle with the following warnings:
13./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.
14
15Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
16Cc: Timur Tabi <timur@kernel.org>
17Cc: Nicolin Chen <nicoleotsuka@gmail.com>
18Cc: Xiubo Li <Xiubo.Lee@gmail.com>
19Cc: Fabio Estevam <festevam@gmail.com>
20Cc: Liam Girdwood <lgirdwood@gmail.com>
21Cc: Mark Brown <broonie@kernel.org>
22Cc: Jaroslav Kysela <perex@perex.cz>
23Cc: Takashi Iwai <tiwai@suse.com>
24Cc: alsa-devel@alsa-project.org
25Cc: linuxppc-dev@lists.ozlabs.org
26Cc: linux-kernel@vger.kernel.org
27Signed-off-by: Mark Brown <broonie@kernel.org>
28Signed-off-by: Sasha Levin <sashal@kernel.org>
29---
30 sound/soc/fsl/fsl_utils.c | 1 +
31 1 file changed, 1 insertion(+)
32
33diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c
34index b9e42b503a377..4f8bdb7650e84 100644
35--- a/sound/soc/fsl/fsl_utils.c
36+++ b/sound/soc/fsl/fsl_utils.c
37@@ -75,6 +75,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
38 iprop = of_get_property(dma_np, "cell-index", NULL);
39 if (!iprop) {
40 of_node_put(dma_np);
41+ of_node_put(dma_channel_np);
42 return -EINVAL;
43 }
44 *dma_id = be32_to_cpup(iprop);
45--
462.20.1
47