mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
hwmon: (emc2305) Fix a resource leak in emc2305_of_parse_pwm_child
When calling of_parse_phandle_with_args(), the caller is responsible to call of_node_put() to release the reference of device node. In emc2305_of_parse_pwm_child, it does not release the reference, causing a resource leak. Signed-off-by: Felix Gu <gu_0233@qq.com> Link: https://lore.kernel.org/r/tencent_738BA80BBF28F3440301EEE6F9E470165105@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
13bf63b931
commit
2954ce672b
1 changed files with 1 additions and 0 deletions
|
|
@ -578,6 +578,7 @@ static int emc2305_of_parse_pwm_child(struct device *dev,
|
|||
data->pwm_output_mask |= EMC2305_OPEN_DRAIN << ch;
|
||||
}
|
||||
|
||||
of_node_put(args.np);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue