From: Maciej Fijalkowski Date: Thu, 28 Feb 2019 23:25:52 +0000 (-0800) Subject: ice: Validate ring existence and its q_vector per VSI X-Git-Tag: Ubuntu-5.10.0-12.13~5442^2~51^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a92e1bb6ade7526f0c2b7b462516b1941e965504;p=mirror_ubuntu-hirsute-kernel.git ice: Validate ring existence and its q_vector per VSI When stopping Tx rings, we use 'i' as an ring array index for looking up whether the ice_ring exists and have assigned a q_vector. This checks rings only within a given TC and we need to go through every ring in VSI. Use 'q_idx' instead. Signed-off-by: Maciej Fijalkowski Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 61bb9e92f6ce..57b2873a6123 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -2072,7 +2072,8 @@ ice_vsi_stop_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, for (i = 0; i < vsi->tc_cfg.tc_info[tc].qcount_tx; i++) { u16 v_idx; - if (!rings || !rings[i] || !rings[i]->q_vector) { + if (!rings || !rings[q_idx] || + !rings[q_idx]->q_vector) { err = -EINVAL; goto err_out; }