Re: [PATCH net-next] net: dsa: mv88e6xxx: fix unreleased fwnode_handle in setup_port()

From: Andrew Lunn
Date: Sat Oct 19 2024 - 17:59:25 EST


On Sat, Oct 19, 2024 at 10:16:49PM +0200, Javier Carrasco wrote:
> 'ports_fwnode' is initialized via device_get_named_child_node(), which
> requires a call to fwnode_handle_put() when the variable is no longer
> required to avoid leaking memory.
>
> Add the missing fwnode_handle_put() after 'ports_fwnode' has been used
> and is no longer required.

As you point out, the handle is obtained with
device_get_named_child_node(). It seems odd to use a fwnode_ function
not a device_ function to release the handle. Is there a device_
function?

Andrew