Subject: [PATCH 4.19 131/187] ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe

From: Greg Kroah-Hartman <[email-masked]>
Date: Thu, 4 Apr 2019 10:47:48 +0200

4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

[ Upstream commit 11907e9d3533648615db08140e3045b829d2c141 ]

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Signed-off-by: Wen Yang <[email-masked]>
Cc: Timur Tabi <[email-masked]>
Cc: Nicolin Chen <[email-masked]>
Cc: Xiubo Li <[email-masked]>
Cc: Fabio Estevam <[email-masked]>
Cc: Liam Girdwood <[email-masked]>
Cc: Mark Brown <[email-masked]>
Cc: Jaroslav Kysela <[email-masked]>
Cc: Takashi Iwai <[email-masked]>
Cc: [email-masked]
Cc: [email-masked]
Cc: [email-masked]
Signed-off-by: Mark Brown <[email-masked]>
Signed-off-by: Sasha Levin <[email-masked]>
---
 sound/soc/fsl/fsl-asoc-card.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 44433b20435c..600d9be9706e 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -689,6 +689,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
 asrc_fail:
 	of_node_put(asrc_np);
 	of_node_put(codec_np);
+	put_device(&cpu_pdev->dev);
 fail:
 	of_node_put(cpu_np);
 
-- 
2.19.1