pinctrl: samsung: Add of_node_put() before return in error path
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Sun, 4 Aug 2019 16:02:00 +0000 (21:32 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 18:56:37 +0000 (19:56 +0100)
commit4e8285d98c520eebb3a5c8740279a537684f98f1
tree8111f73baf1026feb71b035a9a90f85ac96b9ecc
parent0298d6cf85462e8ba090fa37a6a30008d97c4afb
pinctrl: samsung: Add of_node_put() before return in error path

commit 3d2557ab75d4c568c79eefa2e550e0d80348a6bd upstream.

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 of
exynos_eint_wkup_init() error path.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Cc: <stable@vger.kernel.org>
Fixes: 14c255d35b25 ("pinctrl: exynos: Add irq_chip instance for Exynos7 wakeup interrupts")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/samsung/pinctrl-exynos.c