[PATCH net-next v2 03/11] net: stmmac: dwmac-qcom-ethqos: Drop an if with an always false condition

Michal Kubiak michal.kubiak at intel.com
Mon May 8 13:26:46 PDT 2023


On Mon, May 08, 2023 at 04:26:29PM +0200, Uwe Kleine-König wrote:
> The remove callback is only ever called after .probe() returned
> successfully. After that get_stmmac_bsp_priv() always return non-NULL.

Nitpick: "always returns" or "will always return".

> 
> Side note: The early exit would also be a bug because the return value
> of qcom_ethqos_remove() is ignored by the device core and the device is
> unbound unconditionally. So exiting early resulted in a dangerous
> resource leak as all devm allocated resources (some memory and the
> register mappings) are freed but the network device stays around.  Using
> the network device afterwards probably oopses.
> 
> Reviewed-by: Simon Horman <simon.horman at corigine.com>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>

Thanks,
Michal



More information about the linux-arm-kernel mailing list