diff options
| author | Erick Karanja <karanja99erick@gmail.com> | 2025-10-12 21:12:49 +0300 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2025-10-19 18:56:14 -0700 |
| commit | 57f6f47920ef2f598c46d0a04bd9c8984c98e6df (patch) | |
| tree | 6772dc7dd65207d592fc2d4c81c7ae4820cd6ad1 | |
| parent | 72ac14851012d45dcbb9d3533e372e33001b873e (diff) | |
| download | tip-57f6f47920ef2f598c46d0a04bd9c8984c98e6df.tar.gz | |
hwmon: (pmbus/isl68137) Fix child node reference leak on early return
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 <karanja99erick@gmail.com>
Link: https://lore.kernel.org/r/20251012181249.359401-1-karanja99erick@gmail.com
[groeck: Updated subject/description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| -rw-r--r-- | drivers/hwmon/pmbus/isl68137.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus/isl68137.c b/drivers/hwmon/pmbus/isl68137.c index 52cf62e45a86f1..6bba9b50c51bfc 100644 --- a/drivers/hwmon/pmbus/isl68137.c +++ b/drivers/hwmon/pmbus/isl68137.c @@ -336,10 +336,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; |
