i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
[ Upstream commit 9525a3c38accd2e186f52443e35e633e296cc7f5 ] Add check for pf->vf not being NULL before dereferencing pf->vf[vsi->vf_id] in updating VSI filter sync. Add a similar check before dereferencing !pf->vf[vsi->vf_id].trusted in the condition for clearing promisc mode bit. Fixes: c87c938f62d8 ("i40e: Add VF VLAN pruning") Signed-off-by: Andrii Staikov <andrii.staikov@intel.com> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
aff3994d4b
commit
6e5e4223c8
@ -2595,7 +2595,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
retval = i40e_correct_mac_vlan_filters
|
||||
(vsi, &tmp_add_list, &tmp_del_list,
|
||||
vlan_filters);
|
||||
else
|
||||
else if (pf->vf)
|
||||
retval = i40e_correct_vf_mac_vlan_filters
|
||||
(vsi, &tmp_add_list, &tmp_del_list,
|
||||
vlan_filters, pf->vf[vsi->vf_id].trusted);
|
||||
@ -2768,7 +2768,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
|
||||
}
|
||||
|
||||
/* if the VF is not trusted do not do promisc */
|
||||
if ((vsi->type == I40E_VSI_SRIOV) && !pf->vf[vsi->vf_id].trusted) {
|
||||
if (vsi->type == I40E_VSI_SRIOV && pf->vf &&
|
||||
!pf->vf[vsi->vf_id].trusted) {
|
||||
clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user