]> git.baikalelectronics.ru Git - kernel.git/commit
drm/rockchip: add missing of_node_put
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 13 Jan 2019 08:47:43 +0000 (09:47 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 13 Jan 2019 18:20:45 +0000 (19:20 +0100)
commit25dc330ed6d4da9db6003f19425a39dd7db949a1
treec4641390c2ede15a0fecd8487f80c9e15d64b0f3
parentaa546cfd497ca08de444e1850812b49d30523c76
drm/rockchip: add missing of_node_put

The device node iterators perform 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>
@@
expression root,e;
local idexpression child;
iterator name for_each_child_of_node;
@@

 for_each_child_of_node(root, child) {
   ... when != of_node_put(child)
       when != e = child
+  of_node_put(child);
?  break;
   ...
}
... when != child
// </smpl>

Fixes: e93fbec15e08 ("drm/rockchip: Add support for Rockchip Soc RGB output interface")
Cc: stable@vger.kernel.org
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
[added fixes and cc-stable]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1547369264-24831-4-git-send-email-Julia.Lawall@lip6.fr
drivers/gpu/drm/rockchip/rockchip_rgb.c