]>
Commit | Line | Data |
---|---|---|
1143c684 SL |
1 | From ef65a84f40cbd4d57520c34cb9467dc58ea9b930 Mon Sep 17 00:00:00 2001 |
2 | From: Wen Yang <wen.yang99@zte.com.cn> | |
3 | Date: Tue, 26 Feb 2019 16:17:50 +0800 | |
4 | Subject: ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put | |
5 | ||
6 | [ Upstream commit c705247136a523488eac806bd357c3e5d79a7acd ] | |
7 | ||
8 | The call to of_parse_phandle returns a node pointer with refcount | |
9 | incremented thus it must be explicitly decremented after the last | |
10 | usage. | |
11 | ||
12 | Detected 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 | ||
15 | Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> | |
16 | Cc: Timur Tabi <timur@kernel.org> | |
17 | Cc: Nicolin Chen <nicoleotsuka@gmail.com> | |
18 | Cc: Xiubo Li <Xiubo.Lee@gmail.com> | |
19 | Cc: Fabio Estevam <festevam@gmail.com> | |
20 | Cc: Liam Girdwood <lgirdwood@gmail.com> | |
21 | Cc: Mark Brown <broonie@kernel.org> | |
22 | Cc: Jaroslav Kysela <perex@perex.cz> | |
23 | Cc: Takashi Iwai <tiwai@suse.com> | |
24 | Cc: alsa-devel@alsa-project.org | |
25 | Cc: linuxppc-dev@lists.ozlabs.org | |
26 | Cc: linux-kernel@vger.kernel.org | |
27 | Signed-off-by: Mark Brown <broonie@kernel.org> | |
28 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
29 | --- | |
30 | sound/soc/fsl/fsl_utils.c | 1 + | |
31 | 1 file changed, 1 insertion(+) | |
32 | ||
33 | diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c | |
34 | index 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 | -- | |
46 | 2.20.1 | |
47 |