pinctrl: rzn1: Add of_node_put() before return
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sun, 4 Aug 2019 15:40:29 +0000 (21:10 +0530)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 5 Aug 2019 07:23:57 +0000 (09:23 +0200)
commit2f64dc70baba18dc0b2d91d92f13bda7f2f28112
tree2d81d0bc2624740db8275936c895f1d65288e656
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b
pinctrl: rzn1: 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-rzn1.c