forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/drivers/net/ethernet/qlogic/qed/qed_sriov.c
....@@ -4378,6 +4378,9 @@
43784378 }
43794379
43804380 vf = qed_iov_get_vf_info(QED_LEADING_HWFN(cdev), (u16)vfid, true);
4381
+ if (!vf)
4382
+ return -EINVAL;
4383
+
43814384 vport_id = vf->vport_id;
43824385
43834386 return qed_configure_vport_wfq(cdev, vport_id, rate);
....@@ -5123,7 +5126,7 @@
51235126
51245127 /* Validate that the VF has a configured vport */
51255128 vf = qed_iov_get_vf_info(hwfn, i, true);
5126
- if (!vf->vport_instance)
5129
+ if (!vf || !vf->vport_instance)
51275130 continue;
51285131
51295132 memset(&params, 0, sizeof(params));