From: Yige Jiang <yigejiang86@gmail.com>
To: linux-fsi@lists.ozlabs.org
Cc: Yige Jiang <yigejiang86@gmail.com>,
Eddie James <eajames@linux.ibm.com>,
Ninad Palsule <ninad@linux.ibm.com>,
Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>,
Ryan Chen <ryan_chen@aspeedtech.com>,
Billy Tsai <billy_tsai@aspeedtech.com>,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Wentao Liang <vulab@iscas.ac.cn>,
Guangshuo Li <lgs201920130244@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] fsi: aspeed: release the master device node with the device
Date: Thu, 5 Nov 2026 16:04:14 +0800 [thread overview]
Message-ID: <rc-review-20261105-32-59f96c1fdaf1@gmail.com> (raw)
In-Reply-To: <20260913060242.1426845-1-lgs201920130244@gmail.com>
fsi_master_aspeed_probe() takes a node reference for master.dev.
The posted error-path fix releases it before directly freeing the
allocation, but the successful registration path still retains it
when the master device is finally released.
Put the node in aspeed_master_release() before freeing the containing
object. With the posted remove-path device put, this keeps the node
valid until the last master-device user is gone and balances the
successful path without repeating the error-path put.
Fixes: 606397d67f41 ("fsi: Add ast2600 master driver")
Link: https://patchwork.kernel.org/series/1166294/
Link: https://patchwork.kernel.org/series/1163700/
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
Based on linux-next next-20261102 (2637bdec0535).
Compile-tested: arm64, GCC 14.2.0, W=1, CONFIG_OF_DYNAMIC=y.
COMPILE_TEST=y.
Baseline and patched target objects built from this exact base.
No full kernel/module-link, hardware or runtime test was performed.
AI assistance was used for analysis and patch preparation.
This is an incremental patch based on the following posted fixes:
[PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe()
<20260916093914.2005582-1-vulab@iscas.ac.cn>
[PATCH] fsi: aspeed: fix memory leak on remove
<20260913060242.1426845-1-lgs201920130244@gmail.com>
drivers/fsi/fsi-master-aspeed.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index f0bd760fa78b..cac0a8c73043 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -378,6 +378,7 @@ static void aspeed_master_release(struct device *dev)
struct fsi_master_aspeed *aspeed =
to_fsi_master_aspeed(to_fsi_master(dev));
+ of_node_put(dev->of_node);
kfree(aspeed);
}
base-commit: 2637bdec0535a2044cd830eba9a79363651d9043
prerequisite-patch-id: 0d97a848987c2bd4195686f43f69a0d0c0f69608
prerequisite-patch-id: 00d7444e3a96e93c967d233b9c7c3a79c54647e9
next prev parent reply other threads:[~2026-11-05 8:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 9:39 [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe() Wentao Liang
2026-09-13 6:02 ` [PATCH] fsi: aspeed: fix memory leak on remove Guangshuo Li
2026-11-05 8:04 ` Yige Jiang [this message]
2026-09-16 9:44 ` [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe() Greg KH
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=rc-review-20261105-32-59f96c1fdaf1@gmail.com \
--to=yigejiang86@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=billy_tsai@aspeedtech.com \
--cc=eajames@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@jms.id.au \
--cc=lgs201920130244@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-fsi@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ninad@linux.ibm.com \
--cc=ryan_chen@aspeedtech.com \
--cc=vulab@iscas.ac.cn \
/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®