[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 07 Jul 2019 17:54:17 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Timur Tabi" <timur@...nel.org>,
"Nicolin Chen" <nicoleotsuka@...il.com>,
"Mark Brown" <broonie@...nel.org>,
"Fabio Estevam" <festevam@...il.com>,
"Xiubo Li" <Xiubo.Lee@...il.com>, "Takashi Iwai" <tiwai@...e.de>
Subject: [PATCH 3.16 076/129] ASoC: fsl: Fix of-node refcount unbalance in
fsl_ssi_probe_from_dt()
3.16.70-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@...e.de>
commit 2757970f6d0d0a112247600b23d38c0c728ceeb3 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: f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support")
Cc: Timur Tabi <timur@...nel.org>
Cc: Nicolin Chen <nicoleotsuka@...il.com>
Cc: Xiubo Li <Xiubo.Lee@...il.com>
Cc: Fabio Estevam <festevam@...il.com>
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Acked-by: Nicolin Chen <nicoleotsuka@...il.com>
Signed-off-by: Mark Brown <broonie@...nel.org>
[bwh: Backported to 3.16:
- Move declaration of root to the top of the function as there is no
suitable block scope
- Adjust context]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1229,6 +1229,7 @@ static int fsl_ssi_probe(struct platform
struct fsl_ssi_private *ssi_private;
int ret = 0;
struct device_node *np = pdev->dev.of_node;
+ struct device_node *root;
const struct of_device_id *of_id;
const char *p, *sprop;
const uint32_t *iprop;
@@ -1373,7 +1374,9 @@ static int fsl_ssi_probe(struct platform
* device tree. We also pass the address of the CPU DAI driver
* 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. */
p = strrchr(sprop, ',');
if (p)
Powered by blists - more mailing lists