Re: [PATCH net 1/3] ionic: check for a NULL port_info in the remaining ethtool ops

Vadim Fedorenko <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <[email protected]>
On 15/08/2026 01:00, Eric Joyner wrote:
> port_info is a coherent DMA buffer that the firmware keeps up to date.
> ionic_port_init() frees it and sets idev->port_info to NULL when the
> device command to initialize the port fails, and that failure path can
> run while the netdev is still registered:
> 
>    ionic_lif_deferred_work()
>     -> ionic_lif_handle_fw_up()
>         -> ionic_port_init()
> 
>    ionic_reset_done()
>     -> ionic_setup_one()
>         -> ionic_port_init()
> 
> ionic_get_link_ext_stats() and ionic_get_link_ksettings() already test
> the pointer before using it, but the rest of the ethtool ops dereference
> it blindly, so an unprivileged "ethtool --show-fec eth0" can oops after
> a failed firmware recovery.
> 
> Add the same check to the ops that were missing it.
> 
> Fixes: c672412f6172 ("ionic: remove lifs on fw reset")
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Eric Joyner <[email protected]>
> ---
>   .../net/ethernet/pensando/ionic/ionic_ethtool.c    | 30 ++++++++++++++++++++++
>   1 file changed, 30 insertions(+)

Reviewed-by: Vadim Fedorenko <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.