projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fae00a7
)
hwmon: (emc2305) fix double put in emc2305_probe_childs_from_dt
author
Pei Xiao
<xiaopei01@kylinos.cn>
Fri, 5 Dec 2025 02:02:41 +0000
(10:02 +0800)
committer
Guenter Roeck
<linux@roeck-us.net>
Sun, 7 Dec 2025 22:10:18 +0000
(14:10 -0800)
./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>
drivers/hwmon/emc2305.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/emc2305.c
b/drivers/hwmon/emc2305.c
index
6080928
..
b0f2318
100644
(file)
--- a/
drivers/hwmon/emc2305.c
+++ b/
drivers/hwmon/emc2305.c
@@
-593,10
+593,8
@@
static int emc2305_probe_childs_from_dt(struct device *dev)
for_each_child_of_node(dev->of_node, child) {
if (of_property_present(child, "reg")) {
ret = emc2305_of_parse_pwm_child(dev, child, data);
- if (ret) {
- of_node_put(child);
+ if (ret)
continue;
- }
count++;
}
}