Skip to content

Commit 541dfb4

Browse files
Pei Xiaogroeck
authored andcommitted
hwmon: (emc2305) fix double put in emc2305_probe_childs_from_dt
./drivers/hwmon/emc2305.c:597:4-15: ERROR: probable double put Device node iterators put the previous value of the index variable, so an explicit put causes a double put. Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Link: https://lore.kernel.org/r/tencent_CD373F952BE48697C949E39CB5EB77841D06@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent fae00a7 commit 541dfb4

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/hwmon/emc2305.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,8 @@ static int emc2305_probe_childs_from_dt(struct device *dev)
593593
for_each_child_of_node(dev->of_node, child) {
594594
if (of_property_present(child, "reg")) {
595595
ret = emc2305_of_parse_pwm_child(dev, child, data);
596-
if (ret) {
597-
of_node_put(child);
596+
if (ret)
598597
continue;
599-
}
600598
count++;
601599
}
602600
}

0 commit comments

Comments
 (0)