summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-19 10:46:47 -0500
committerMark Brown <broonie@kernel.org>2019-02-20 07:02:50 -0500
commit2757970f6d0d0a112247600b23d38c0c728ceeb3 (patch)
tree9c8f3bec992f37345172a7d8810c7c4726128e8e
parentfb13f19d102ee47c0f27fda70387052a3fd3e656 (diff)
ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt()
The node obtained from of_find_node_by_path() has to be unreferenced after the use, but we forgot it for the root node. Fixes: f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support") 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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl_ssi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 0a648229e643..09b2967befd9 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1439,8 +1439,10 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
1439 * different name to register the device. 1439 * different name to register the device.
1440 */ 1440 */
1441 if (!ssi->card_name[0] && of_get_property(np, "codec-handle", NULL)) { 1441 if (!ssi->card_name[0] && of_get_property(np, "codec-handle", NULL)) {
1442 sprop = of_get_property(of_find_node_by_path("/"), 1442 struct device_node *root = of_find_node_by_path("/");
1443 "compatible", NULL); 1443
1444 sprop = of_get_property(root, "compatible", NULL);
1445 of_node_put(root);
1444 /* Strip "fsl," in the compatible name if applicable */ 1446 /* Strip "fsl," in the compatible name if applicable */
1445 p = strrchr(sprop, ','); 1447 p = strrchr(sprop, ',');
1446 if (p) 1448 if (p)