soc: qcom: pmic: Fix resource leaks in a device_for_each_child_node() loop
authorLu Hongfei <luhongfei@vivo.com>
Mon, 12 Jun 2023 13:34:52 +0000 (21:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:19:41 +0000 (17:19 +0000)
commitbce7b184f2698a2bdf73156d0256bf8cef36a4ed
tree550d61b4eccae44ec2e266574709869caee867bf
parent09f617219fe9ccd8d7b65dc3e879b5889f663b5a
soc: qcom: pmic: Fix resource leaks in a device_for_each_child_node() loop

[ Upstream commit 5692aeea5bcb9331e956628c3bc8fc9afcc9765d ]

The device_for_each_child_node loop should call fwnode_handle_put()
before return in the error cases, to avoid resource leaks.

Let's fix this bug in pmic_glink_altmode_probe().

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
Link: https://lore.kernel.org/r/20230612133452.47315-1-luhongfei@vivo.com
[bjorn: Rebased patch, moved fw_handle_put() from jump target into the loop]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/pmic_glink_altmode.c