]> git.baikalelectronics.ru Git - kernel.git/commit
ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats()
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Mon, 7 Mar 2022 17:47:39 +0000 (18:47 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 15 Mar 2022 20:36:13 +0000 (13:36 -0700)
commit0e834a2201aaf3c756b78b4035295a5834b074ee
tree1f7ac177d4fd1df52ef1e420412eb1f3b60ad1fd
parent3d8303b483c81b3cf7e703d1258495f68f6f37c0
ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats()

It is possible to do NULL pointer dereference in routine that updates
Tx ring stats. Currently only stats and bytes are updated when ring
pointer is valid, but later on ring is accessed to propagate gathered Tx
stats onto VSI stats.

Change the existing logic to move to next ring when ring is NULL.

Fixes: 8015762f94a4 ("ice: split ice_ring onto Tx/Rx separate structs")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c