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

From: Paolo Abeni
Date: Tue Jul 18 2023 - 04:54:51 EST


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