From 42cf34d3f8faccdcb7a1b6dae8cd84c020563042 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Fri, 15 May 2026 21:53:29 +0200 Subject: [PATCH] realtek: pcs: use devm_kzalloc() Just for safety. Use device managed operation so the memory is automatically reclaimed when the parent PCS controller is removed. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/23391 Signed-off-by: Robert Marko --- target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index 91ba92e8e27..1668c61fe4e 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -4110,7 +4110,7 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int if (sds->num_of_links >= RTPCS_MAX_LINKS_PER_SDS) return ERR_PTR(-ERANGE); - link = kzalloc(sizeof(*link), GFP_KERNEL); + link = devm_kzalloc(ctrl->dev, sizeof(*link), GFP_KERNEL); if (!link) { put_device(&pdev->dev); return ERR_PTR(-ENOMEM);