diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2017-07-15 09:19:07 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-07-17 15:39:51 +0100 |
commit | 53ba2aa314164f7fcd3acf9594313811256a52c4 (patch) | |
tree | be856198f390b83ace8884e59fa689b1562c5578 /sound/soc/sh/rcar/mix.c | |
parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) | |
download | linux-53ba2aa314164f7fcd3acf9594313811256a52c4.tar.bz2 |
ASoC: rsnd: add missing of_node_put
for_each_child_of_node performs an of_node_get on each iteration, so a
jump out of the loop requires an of_node_put.
The semantic patch that fixes this problem is as follows
(http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e,e1;
identifier l;
@@
for_each_child_of_node(e1,n) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? goto l;
)
...
}
...
l: ... when != n
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/mix.c')
-rw-r--r-- | sound/soc/sh/rcar/mix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c index 195fc7bb22af..6c4826c189a4 100644 --- a/sound/soc/sh/rcar/mix.c +++ b/sound/soc/sh/rcar/mix.c @@ -168,13 +168,16 @@ int rsnd_mix_probe(struct rsnd_priv *priv) clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_mix_probe_done; } ret = rsnd_mod_init(priv, rsnd_mod_get(mix), &rsnd_mix_ops, clk, rsnd_mod_get_status, RSND_MOD_MIX, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_mix_probe_done; + } i++; } |