Skip to content

Commit 425c5f2

Browse files
Xuanqiang Luokuba-moo
authored andcommitted
ice: Check VF VSI Pointer Value in ice_vc_add_fdir_fltr()
As mentioned in the commit baeb705 ("ice: always check VF VSI pointer values"), we need to perform a null pointer check on the return value of ice_get_vf_vsi() before using it. Fixes: 6ebbe97 ("ice: Add a per-VF limit on number of FDIR filters") Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://patch.msgid.link/20250425222636.3188441-3-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3ffcd7b commit 425c5f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,11 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
20972097
pf = vf->pf;
20982098
dev = ice_pf_to_dev(pf);
20992099
vf_vsi = ice_get_vf_vsi(vf);
2100+
if (!vf_vsi) {
2101+
dev_err(dev, "Can not get FDIR vf_vsi for VF %u\n", vf->vf_id);
2102+
v_ret = VIRTCHNL_STATUS_ERR_PARAM;
2103+
goto err_exit;
2104+
}
21002105

21012106
#define ICE_VF_MAX_FDIR_FILTERS 128
21022107
if (!ice_fdir_num_avail_fltr(&pf->hw, vf_vsi) ||

0 commit comments

Comments
 (0)