Skip to content

Commit 75871a5

Browse files
Tianyu Xuanguy11
authored andcommitted
igb: Fix NULL pointer dereference in ethtool loopback test
The igb driver currently causes a NULL pointer dereference when executing the ethtool loopback test. This occurs because there is no associated q_vector for the test ring when it is set up, as interrupts are typically not added to the test rings. Since commit 5ef44b3 removed the napi_id assignment in __xdp_rxq_info_reg(), there is no longer a need to pass a napi_id to it. Therefore, simply use 0 as the last parameter. Fixes: 2c61960 ("igb: Add AF_XDP zero-copy Rx support") Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Joe Damato <[email protected]> Signed-off-by: Tianyu Xu <[email protected]> Reviewed-by: Paul Menzel <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent e3c674d commit 75871a5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
44534453
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
44544454
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
44554455
res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
4456-
rx_ring->queue_index,
4457-
rx_ring->q_vector->napi.napi_id);
4456+
rx_ring->queue_index, 0);
44584457
if (res < 0) {
44594458
dev_err(dev, "Failed to register xdp_rxq index %u\n",
44604459
rx_ring->queue_index);

0 commit comments

Comments
 (0)