public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Weigang He <geoffreyhe2@gmail.com>
To: tony@atomide.com, aaro.koskinen@iki.fi, andreas@kemnade.info,
	khilman@baylibre.com, rogerq@kernel.org
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	Weigang He <geoffreyhe2@gmail.com>,
	stable@vger.kernel.org
Subject: [PATCH] bus: ti-sysc: fix reference count leak on module unload
Date: Sat, 17 Jan 2026 06:28:14 +0000	[thread overview]
Message-ID: <20260117062814.440540-1-geoffreyhe2@gmail.com> (raw)

The stdout_path static variable holds a reference to a device_node
obtained from of_find_node_by_path(). When the ti-sysc module is
unloaded, this reference is never released, causing a reference count
leak.

Add of_node_put(stdout_path) in sysc_exit() to properly release the
device_node reference when the module is unloaded.

Fixes: 3bb37c8e6e6a ("bus: ti-sysc: Handle stdout-path for debug console")
Cc: stable@vger.kernel.org
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
---
 drivers/bus/ti-sysc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index fd631a9889c1e..822b9b1b2f6fa 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -3338,6 +3338,9 @@ module_init(sysc_init);
 
 static void __exit sysc_exit(void)
 {
+	if (!IS_ERR_OR_NULL(stdout_path))
+		of_node_put(stdout_path);
+
 	bus_unregister_notifier(&platform_bus_type, &sysc_nb);
 	platform_driver_unregister(&sysc_driver);
 	sysc_cleanup_static_data();
-- 
2.34.1


                 reply	other threads:[~2026-01-17  6:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260117062814.440540-1-geoffreyhe2@gmail.com \
    --to=geoffreyhe2@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=andreas@kemnade.info \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rogerq@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tony@atomide.com \
    /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