diff options
| author | Felix Gu <gu_0233@qq.com> | 2026-01-15 21:54:15 +0800 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:20:13 -0500 |
| commit | fb99b58763a95e20b214fc1dd86837ae00a400b7 (patch) | |
| tree | 8e2057a15a5c4d5a4e9082ecf7ca5721fdada509 /drivers/hwmon | |
| parent | b1b9ba9d5a52490c5741b9a2dbd701d33938cec2 (diff) | |
hwmon: (nct7363) Fix a resource leak in nct7363_present_pwm_fanin
[ Upstream commit 4923bbff0bcffe488b3aa76829c829bd15b02585 ]
When calling of_parse_phandle_with_args(), the caller is responsible
to call of_node_put() to release the reference of device node.
In nct7363_present_pwm_fanin, 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_9717645269E4C07D3D131F52201E12E5E10A@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/nct7363.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwmon/nct7363.c b/drivers/hwmon/nct7363.c index 71cef794835d..47fc1b4a0f3f 100644 --- a/drivers/hwmon/nct7363.c +++ b/drivers/hwmon/nct7363.c @@ -349,6 +349,7 @@ static int nct7363_present_pwm_fanin(struct device *dev, if (ret) return ret; + of_node_put(args.np); if (args.args[0] >= NCT7363_PWM_COUNT) return -EINVAL; data->pwm_mask |= BIT(args.args[0]); |
