Thread (9 messages) flat view 9 messages, 3 authors, 4d ago

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

From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: 2026-08-15 22:39:25

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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help