Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Pei Xiao and committed by
Guenter Roeck
541dfb49 fae00a71

+1 -3
+1 -3
drivers/hwmon/emc2305.c
··· 593 593 for_each_child_of_node(dev->of_node, child) { 594 594 if (of_property_present(child, "reg")) { 595 595 ret = emc2305_of_parse_pwm_child(dev, child, data); 596 - if (ret) { 597 - of_node_put(child); 596 + if (ret) 598 597 continue; 599 - } 600 598 count++; 601 599 } 602 600 }