Commit 8a845c02 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

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

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>
parent a5e2c650
...@@ -1439,8 +1439,10 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi) ...@@ -1439,8 +1439,10 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
* different name to register the device. * different name to register the device.
*/ */
if (!ssi->card_name[0] && of_get_property(np, "codec-handle", NULL)) { if (!ssi->card_name[0] && of_get_property(np, "codec-handle", NULL)) {
sprop = of_get_property(of_find_node_by_path("/"), struct device_node *root = of_find_node_by_path("/");
"compatible", NULL);
sprop = of_get_property(root, "compatible", NULL);
of_node_put(root);
/* Strip "fsl," in the compatible name if applicable */ /* Strip "fsl," in the compatible name if applicable */
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