From: Erick Karanja Date: Sun, 12 Oct 2025 18:12:49 +0000 (+0300) Subject: hwmon: (pmbus/isl68137) Fix child node reference leak on early return X-Git-Tag: v6.17.6~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f957c0f9975d9314b3c054ad5e4f6badd2eacc14;p=thirdparty%2Fkernel%2Fstable.git hwmon: (pmbus/isl68137) Fix child node reference leak on early return [ Upstream commit 57f6f47920ef2f598c46d0a04bd9c8984c98e6df ] In the case of an early return, the reference to the child node needs to be released. Use for_each_child_of_node_scoped to fix the issue. Fixes: 3996187f80a0e ("hwmon: (pmbus/isl68137) add support for voltage divider on Vout") Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/20251012181249.359401-1-karanja99erick@gmail.com [groeck: Updated subject/description] Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- diff --git a/drivers/hwmon/pmbus/isl68137.c b/drivers/hwmon/pmbus/isl68137.c index c52c55d2e7f48..0c6b31ee755b9 100644 --- a/drivers/hwmon/pmbus/isl68137.c +++ b/drivers/hwmon/pmbus/isl68137.c @@ -334,10 +334,9 @@ static int isl68137_probe_from_dt(struct device *dev, struct isl68137_data *data) { const struct device_node *np = dev->of_node; - struct device_node *child; int err; - for_each_child_of_node(np, child) { + for_each_child_of_node_scoped(np, child) { if (strcmp(child->name, "channel")) continue;