]> 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)
commitfedc4198efeb6e7d990f17a65ce9a2ad83359b3c
tree1f7ac177d4fd1df52ef1e420412eb1f3b60ad1fd
parent756ec1db8563d1e5ac4ec84f3a88d18d4aef168d
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: d338174e092c ("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