From: Markus Stockhausen Date: Fri, 15 May 2026 19:53:29 +0000 (+0200) Subject: realtek: pcs: use devm_kzalloc() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F23391%2Fhead;p=thirdparty%2Fopenwrt.git 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 --- 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);