Skip to content

Commit 57f6f47

Browse files
Erickkaranjagroeck
authored andcommitted
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: 3996187 ("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>
1 parent 72ac148 commit 57f6f47

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/hwmon/pmbus/isl68137.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,9 @@ static int isl68137_probe_from_dt(struct device *dev,
336336
struct isl68137_data *data)
337337
{
338338
const struct device_node *np = dev->of_node;
339-
struct device_node *child;
340339
int err;
341340

342-
for_each_child_of_node(np, child) {
341+
for_each_child_of_node_scoped(np, child) {
343342
if (strcmp(child->name, "channel"))
344343
continue;
345344

0 commit comments

Comments
 (0)