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 <redacted>
---
.../net/ethernet/pensando/ionic/ionic_ethtool.c | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>