]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit961a65d25372299d7ddc282ce61b16c32a56f424
tree2d81d0bc2624740db8275936c895f1d65288e656
parent3946fc9291da929ed6836ab79a3b87c34d142954
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