summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorWentao Liang <vulab@iscas.ac.cn>2026-09-17 14:25:35 +0000
committerMark Brown <broonie@kernel.org>2026-09-17 20:58:48 +0100
commitc41b69e9f76fd9632662714c1d37860468e8d773 (patch)
tree19d4d85476d4788180ae32e18b1f93a30cfa17cc /drivers/regulator
parent3ca9370f0a797248694d3b7c71708ffa8e09c55d (diff)
downloadlinux-next-c41b69e9f76fd9632662714c1d37860468e8d773.tar.gz
linux-next-c41b69e9f76fd9632662714c1d37860468e8d773.zip
regulator: core: Fix c_rdev reference leak in regulator_resolve_coupling()
of_parse_coupled_regulator() returns the coupled regulator with its device reference incremented, but regulator_resolve_coupling() returns without dropping it when the coupled regulator belongs to a different coupler, leaking the reference. Fixes: d8ca7d184b33 ("regulator: core: Introduce API for regulators coupling customization") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20260917142535.2156720-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1e950260f441..b54e1d5a2f0c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5861,6 +5861,7 @@ static void regulator_resolve_coupling(struct regulator_dev *rdev)
if (c_rdev->coupling_desc.coupler != coupler) {
rdev_err(rdev, "coupler mismatch with %s\n",
rdev_get_name(c_rdev));
+ put_device(&c_rdev->dev);
return;
}