]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/asoc-eukrea-tlv320-fix-a-leaked-reference-by-adding-.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / asoc-eukrea-tlv320-fix-a-leaked-reference-by-adding-.patch
CommitLineData
1143c684
SL
1From d3cc660362f8816e1b59a7b1063b915250f6a051 Mon Sep 17 00:00:00 2001
2From: Wen Yang <wen.yang99@zte.com.cn>
3Date: Tue, 26 Feb 2019 16:17:51 +0800
4Subject: ASoC: eukrea-tlv320: fix a leaked reference by adding missing
5 of_node_put
6
7[ Upstream commit b820d52e7eed7b30b2dfef5f4213a2bc3cbea6f3 ]
8
9The call to of_parse_phandle returns a node pointer with refcount
10incremented thus it must be explicitly decremented after the last
11usage.
12
13Detected by coccinelle with the following warnings:
14./sound/soc/fsl/eukrea-tlv320.c:121:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo nding object release within this function.
15./sound/soc/fsl/eukrea-tlv320.c:127:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo nding object release within this function.
16
17Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
18Cc: Liam Girdwood <lgirdwood@gmail.com>
19Cc: Mark Brown <broonie@kernel.org>
20Cc: Jaroslav Kysela <perex@perex.cz>
21Cc: Takashi Iwai <tiwai@suse.com>
22Cc: alsa-devel@alsa-project.org
23Cc: linux-kernel@vger.kernel.org
24Signed-off-by: Mark Brown <broonie@kernel.org>
25Signed-off-by: Sasha Levin <sashal@kernel.org>
26---
27 sound/soc/fsl/eukrea-tlv320.c | 4 ++--
28 1 file changed, 2 insertions(+), 2 deletions(-)
29
30diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c
31index 883087f2b092b..38132143b7d5e 100644
32--- a/sound/soc/fsl/eukrea-tlv320.c
33+++ b/sound/soc/fsl/eukrea-tlv320.c
34@@ -119,13 +119,13 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
35 if (ret) {
36 dev_err(&pdev->dev,
37 "fsl,mux-int-port node missing or invalid.\n");
38- return ret;
39+ goto err;
40 }
41 ret = of_property_read_u32(np, "fsl,mux-ext-port", &ext_port);
42 if (ret) {
43 dev_err(&pdev->dev,
44 "fsl,mux-ext-port node missing or invalid.\n");
45- return ret;
46+ goto err;
47 }
48
49 /*
50--
512.20.1
52