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>
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);