Skip to content

Commit 46345b3

Browse files
Colin Ian KingJeff Kirsher
authored andcommitted
i40e: check that pointer VSI is not null before dereferencing it
Function i40e_find_vsi_from_id can potentially return null, hence VSI may be null, so defensively check it is non-null before dereferencing it to check the seid. Fixes: e284fc2 ("i40e: Add and delete cloud filter") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Avinash Dayanand <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent e85c1b8 commit 46345b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3062,7 +3062,7 @@ static struct i40e_vsi *i40e_find_vsi_from_seid(struct i40e_vf *vf, u16 seid)
30623062

30633063
for (i = 0; i < vf->num_tc ; i++) {
30643064
vsi = i40e_find_vsi_from_id(pf, vf->ch[i].vsi_id);
3065-
if (vsi->seid == seid)
3065+
if (vsi && vsi->seid == seid)
30663066
return vsi;
30673067
}
30683068
return NULL;

0 commit comments

Comments
 (0)