]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/rockchip: lvds: add missing of_node_put
authorJulia Lawall <Julia.Lawall@lip6.fr>
Wed, 23 May 2018 19:07:16 +0000 (21:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:58 +0000 (09:46 +0200)
commit2781b277d5892fb3b2aad4dd741c07dab387c58d
treec978edace060d71251d478949fdb6d984ad1b3e4
parent590eda32ee4291e3862c607f69711192a6612b03
drm/rockchip: lvds: add missing of_node_put

commit ebfb081edc8afd250a6d290c37481bfb2262e7cb upstream.

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: 34cc0aa25456 ("drm/rockchip: Add support for Rockchip Soc LVDS")
Cc: stable@vger.kernel.org
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/rockchip/rockchip_lvds.c