]> git.baikalelectronics.ru Git - kernel.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)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 13 Apr 2021 18:03:36 +0000 (11:03 -0700)
commite37f8e029c2f89f0c2b018ce74de24e132533571
tree5b17e3d0c8ff86f5a701b706471f7f1bd74c408b
parent1d3fd433a6b12cb0cf480fde2261464bde8b1c57
ixgbe: Fix NULL pointer dereference in ethtool loopback test

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: 3e7eb5f5334a ("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>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c