]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ixgbe: Fix NULL pointer dereference in ethtool loopback test
authorAlexander Duyck <alexanderduyck@fb.com>
Mon, 8 Mar 2021 20:41:56 +0000 (12:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:13:23 +0000 (13:13 +0200)
commit758d19098df4b0bbca9f40d6ae6c82c9c18b9bba
tree51f0799f918a8f89af7751d8d0bf8670af876cef
parent7687606c9442c957061bdf57076d59a08c667aa2
ixgbe: Fix NULL pointer dereference in ethtool loopback test

commit 31166efb1cee348eb6314e9c0095d84cbeb66b9d upstream.

The ixgbe driver currently generates a NULL pointer dereference when
performing the ethtool loopback test. This is due to the fact that there
isn't a q_vector associated with the test ring when it is setup as
interrupts are not normally added to the test rings.

To address this I have added code that will check for a q_vector before
returning a napi_id value. If a q_vector is not present it will return a
value of 0.

Fixes: b02e5a0ebb17 ("xsk: Propagate napi_id to XDP socket Rx path")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c