]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: use devm_kzalloc() 23391/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 15 May 2026 19:53:29 +0000 (21:53 +0200)
committerRobert Marko <robimarko@gmail.com>
Sun, 17 May 2026 10:34:47 +0000 (12:34 +0200)
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 <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23391
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c

index 91ba92e8e27775b9bbeee7d4afd43fc04fa65d83..1668c61fe4e29e7b784461a49530e1535f95b341 100644 (file)
@@ -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);