]> Git Repo - linux.git/commitdiff
i40e: check that pointer VSI is not null before dereferencing it
authorColin Ian King <[email protected]>
Thu, 15 Feb 2018 19:50:52 +0000 (19:50 +0000)
committerJeff Kirsher <[email protected]>
Mon, 26 Feb 2018 20:36:46 +0000 (12:36 -0800)
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: e284fc280473 ("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]>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

index 5cca083da93c7c416722fb68c3c90b67d82b9b60..14bbd5c1db7884f91d2d354d82fedc537f139d2c 100644 (file)
@@ -3062,7 +3062,7 @@ static struct i40e_vsi *i40e_find_vsi_from_seid(struct i40e_vf *vf, u16 seid)
 
        for (i = 0; i < vf->num_tc ; i++) {
                vsi = i40e_find_vsi_from_id(pf, vf->ch[i].vsi_id);
-               if (vsi->seid == seid)
+               if (vsi && vsi->seid == seid)
                        return vsi;
        }
        return NULL;
This page took 0.066337 seconds and 4 git commands to generate.