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 19:35:07 +0000 (20:35 +0100)
commit0c72a9f1f9dd3ce80ca7976c8534a095f4743483
tree30ef8040f82af3dfbdecbdb4ca18988b873262c9
parent935057b02087c8729d6e0ae72aaf42a2b45a4d21
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