i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
authorAndrii Staikov <andrii.staikov@intel.com>
Tue, 22 Aug 2023 22:16:53 +0000 (15:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 14:11:03 +0000 (16:11 +0200)
commit136861956ad64429afbe31cfa90234114f7eab2e
tree3850d1d9aae6e235a5572c8e20e41d21d399f795
parent581668893e3126176b08349b7e35a3fd6b578d6a
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>
drivers/net/ethernet/intel/i40e/i40e_main.c