Re: [PATCH net 2/2] net: ti: am65-cpsw-nuss: Fix NULL pointer dereference at module removal

From: Jakub Kicinski
Date: Sat Nov 18 2023 - 23:45:53 EST


On Thu, 16 Nov 2023 13:09:30 +0200 Roger Quadros wrote:
> The NULL pointer derefernce error seems to come from the
> list_for_each_entry_safe() helper in free_netdev(). It looks like
> the napi pointers are stale contents but I coudn't figure out why.

Some interplay with am65_cpsw_nuss_free_tx_chns()?
It does:

memset(tx_chn, 0, sizeof(*tx_chn));

which will wipe the NAPI instance, including its struct list_head.

AFAICT the patch as posted misses free_netdev() on some error paths.
--
pw-bot: cr