mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felix Gu <gu_0233@qq.com>
To: Guenter Roeck <linux@roeck-us.net>, Ban Feng <kcfeng0@nuvoton.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Felix Gu <gu_0233@qq.com>
Subject: [PATCH 1/2] hwmon: emc2305: Fix a resource leak in emc2305_of_parse_pwm_child
Date: Thu, 15 Jan 2026 21:51:48 +0800	[thread overview]
Message-ID: <tencent_738BA80BBF28F3440301EEE6F9E470165105@qq.com> (raw)
In-Reply-To: <tencent_98E69D461A9CE773D3611822369100FE5A06@qq.com>

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>
---
 drivers/hwmon/emc2305.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c
index 8f80a39574f3..64b213e1451e 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;
 }
 
-- 
2.43.0


  reply	other threads:[~2026-01-15 13:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 13:22 [PATCH 0/2] hwmon: Fix resource leaks for device_node Felix Gu
2026-01-15 13:51 ` Felix Gu [this message]
2026-01-15 16:45   ` [PATCH 1/2] hwmon: emc2305: Fix a resource leak in emc2305_of_parse_pwm_child Guenter Roeck
2026-01-15 13:54 ` [PATCH 2/2] hwmon: nct7363: Fix a resource leak in nct7363_present_pwm_fanin Felix Gu
2026-01-15 16:47   ` Guenter Roeck
2026-01-15 17:23 ` [0/2] hwmon: Fix resource leaks for device_node Markus Elfring
     [not found] <20260115-hwmon-fixes-v1-0-305e15192884@qq.com>
2026-01-15 13:42 ` [PATCH 1/2] hwmon: emc2305: Fix a resource leak in emc2305_of_parse_pwm_child Felix Gu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_738BA80BBF28F3440301EEE6F9E470165105@qq.com \
    --to=gu_0233@qq.com \
    --cc=kcfeng0@nuvoton.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®