]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - sound/soc/sh/rcar/ssi.c
ASoC: rsnd: add missing of_node_put
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 15 Jul 2017 07:19:07 +0000 (09:19 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2017 14:39:51 +0000 (15:39 +0100)
commit53ba2aa314164f7fcd3acf9594313811256a52c4
treebe856198f390b83ace8884e59fa689b1562c5578
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877
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>
sound/soc/sh/rcar/ctu.c
sound/soc/sh/rcar/dvc.c
sound/soc/sh/rcar/mix.c
sound/soc/sh/rcar/src.c
sound/soc/sh/rcar/ssi.c