]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: rza1: Add of_node_put() before return
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Thu, 15 Aug 2019 06:05:03 +0000 (11:35 +0530)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 23 Aug 2019 07:08:10 +0000 (09:08 +0200)
commit52a55e139d1f0f4a4a2b9ab7c65685ac43f0cac7
tree0db1fc1d8e2b4c04c61325170988a0fe5f890de9
parentadb05d9ac8fc073ca7a160c771621f2313ecc1e4
pinctrl: rza1: Add of_node_put() before return

Each iteration of for_each_child_of_node puts the previous node, but in
the case of a return from the middle of the loop, there is no put, thus
causing a memory leak. Hence add an of_node_put before the return in
three places.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/pinctrl-rza1.c