linux-stable/drivers/spmi
Javier Carrasco 77adf4b1f3 spmi: pmic-arb: fix return path in for_each_available_child_of_node()
This loop requires explicit calls to of_node_put() upon early exits
(break, goto, return) to decrement the child refcounter and avoid memory
leaks if the child is not required out of the loop.

A more robust solution is using the scoped variant of the macro, which
automatically calls of_node_put() when the child goes out of scope.

Cc: stable@vger.kernel.org
Fixes: 9799873717 ("spmi: pmic-arb: Add multi bus support")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241001-spmi-pmic-arb-scoped-v1-1-5872bab34ed6@gmail.com
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20241109002829.160973-2-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-10 10:56:46 +01:00
..
hisi-spmi-controller.c spmi: add missing MODULE_DESCRIPTION() macros 2024-07-12 10:44:53 +02:00
Kconfig spmi: mediatek: Add support for MT6873/8192 2021-12-17 17:18:18 +01:00
Makefile spmi: Introduce device-managed functions 2023-12-15 17:27:04 +01:00
spmi-devres.c spmi: Return meaningful errors in spmi_controller_alloc() 2023-12-15 17:27:04 +01:00
spmi-mtk-pmif.c spmi: mediatek: add device id check 2023-12-15 17:27:04 +01:00
spmi-pmic-arb.c spmi: pmic-arb: fix return path in for_each_available_child_of_node() 2024-11-10 10:56:46 +01:00
spmi.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00