mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: WenTao Liang <vulab@iscas.ac.cn>
To: Lee Jones <lee@kernel.org>, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, WenTao Liang <vulab@iscas.ac.cn>
Subject: [PATCH] fix: mfd: of_syscon_register: fix reset_control reference leak on success   path
Date: Fri, 26 Jun 2026 23:11:25 +0800	[thread overview]
Message-ID: <20260626151125.50780-1-vulab@iscas.ac.cn> (raw)

of_reset_control_get_optional_exclusive acquires a reset control
  reference. On the success path, the function stores regmap and np but
  does not store or release the reset handle. Only error paths call
  reset_control_put to release it. This leaks the reset control reference
  on the success path.

Store the reset handle in syscon->reset so it can be properly managed.

Cc: stable@vger.kernel.org
Fixes: 7d1e3bd94828 ("mfd: syscon: Allow reset control for syscon devices")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
 drivers/mfd/syscon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 21a7fcdd2737..28576a3c02fd 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -148,6 +148,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
 
 	syscon->regmap = regmap;
 	syscon->np = np;
+	syscon->reset = reset;
 
 	list_add_tail(&syscon->list, &syscon_list);
 
-- 
2.39.5 (Apple Git-154)


             reply	other threads:[~2026-06-26 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 15:11 WenTao Liang [this message]
2026-06-28  4:03 ` WenTao Liang
2026-08-07 20:35 ` kernel test robot

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=20260626151125.50780-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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®