Commit e2a6bb36 authored by Takashi Iwai's avatar Takashi Iwai Committed by Khalid Elmously

ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt()

BugLink: https://bugs.launchpad.net/bugs/1848589

commit 2757970f upstream.

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: f0fba2ad ("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: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 943675b5
...@@ -1374,6 +1374,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -1374,6 +1374,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
struct fsl_ssi_private *ssi_private; struct fsl_ssi_private *ssi_private;
int ret = 0; int ret = 0;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device_node *root;
const struct of_device_id *of_id; const struct of_device_id *of_id;
const char *p, *sprop; const char *p, *sprop;
const uint32_t *iprop; const uint32_t *iprop;
...@@ -1510,7 +1511,9 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -1510,7 +1511,9 @@ static int fsl_ssi_probe(struct platform_device *pdev)
* device tree. We also pass the address of the CPU DAI driver * device tree. We also pass the address of the CPU DAI driver
* structure. * structure.
*/ */
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL); root = of_find_node_by_path("/");
sprop = of_get_property(root, "compatible", NULL);
of_node_put(root);
/* Sometimes the compatible name has a "fsl," prefix, so we strip it. */ /* Sometimes the compatible name has a "fsl," prefix, so we strip it. */
p = strrchr(sprop, ','); p = strrchr(sprop, ',');
if (p) if (p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment