summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorFelix Gu <gu_0233@qq.com>2026-01-15 21:51:48 +0800
committerSasha Levin <sashal@kernel.org>2026-03-04 07:20:13 -0500
commit32b90da7bdd0168418a6054bf156e8331d5214c1 (patch)
tree52e16839c2a00331cc2489900c766a596ba7e71f /drivers/hwmon
parent716489d1b6ad0f6c1d2d6a18469ea134f6915216 (diff)
hwmon: (emc2305) Fix a resource leak in emc2305_of_parse_pwm_child
[ Upstream commit 2954ce672b7623478c1cfeb69e6a6e4042a3656e ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/emc2305.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c
index ceae96c07ac4..67e82021da21 100644
--- a/drivers/hwmon/emc2305.c
+++ b/drivers/hwmon/emc2305.c
@@ -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;
}