kernel/drivers/net/ethernet/qlogic/qed/qed_sriov.c
.. .. @@ -4378,6 +4378,9 @@ 4378 4378 } 4379 4379 4380 4380 vf = qed_iov_get_vf_info(QED_LEADING_HWFN(cdev), (u16)vfid, true); 4381 + if (!vf)4382 + return -EINVAL;4383 +4381 4384 vport_id = vf->vport_id; 4382 4385 4383 4386 return qed_configure_vport_wfq(cdev, vport_id, rate); .. .. @@ -5123,7 +5126,7 @@ 5123 5126 5124 5127 /* Validate that the VF has a configured vport */ 5125 5128 vf = qed_iov_get_vf_info(hwfn, i, true); 5126 - if (!vf->vport_instance)5129 + if (!vf || !vf->vport_instance)5127 5130 continue; 5128 5131 5129 5132 memset(¶ms, 0, sizeof(params));