[openwrt/openwrt] realtek: use devm_kzalloc() for serdes debugfs setup

LEDE Commits lede-commits at lists.infradead.org
Mon Dec 15 00:29:23 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/a4011797c2fb160a696edfc29993c78ab5edc3d1

commit a4011797c2fb160a696edfc29993c78ab5edc3d1
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Dec 14 10:07:38 2025 +0100

    realtek: use devm_kzalloc() for serdes debugfs setup
    
    This will free memory automatically during driver unloading.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21157
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
index 394af71250..5c8741383f 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c
@@ -148,7 +148,7 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
 	struct dentry *dir, *root;
 	char dirname[32];
 
-	dbg_info = kzalloc(sizeof(*dbg_info), GFP_KERNEL);
+	dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
 	if (!dbg_info)
 		return -ENOMEM;
 




More information about the lede-commits mailing list