[PATCH net v3] net: thunder: bgx: Fix resource leaks in device_for_each_child_node() loops

Paolo Abeni pabeni at redhat.com
Tue Jul 18 01:51:58 PDT 2023


On Fri, 2023-07-14 at 15:06 +0200, Markus Elfring wrote:
> > The device_for_each_child_node() loop in bgx_init_of_phy()
> > function should have fwnode_handle_put() before break which could
> > avoid resource leaks. This patch could fix this bug.
> 
> Are imperative change descriptions still preferred?

Yes. The commit message should be re-phrased.

More importantly, it looks like the relevant reference is already
released by of_node_put() and the additional fwnode_handle_put() will
cause a reference underflow.

This patch does not look correct to me.

Cheers,

Paolo




More information about the linux-arm-kernel mailing list