OpenCloudOS-Kernel/drivers/pinctrl/sprd
Nishka Dasgupta 5a6bc29032 pinctrl: sprd: Add of_node_put() before return to prevent memory leak
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
two places.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190808074329.15579-1-nishkadg.linux@gmail.com
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-08-10 10:22:50 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pinctrl-sprd-sc9860.c pinctrl: sprd: Fix platform_no_drv_owner.cocci warnings 2019-08-03 00:32:34 +02:00
pinctrl-sprd.c pinctrl: sprd: Add of_node_put() before return to prevent memory leak 2019-08-10 10:22:50 +02:00
pinctrl-sprd.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00