iavf: free q_vectors before queues in iavf_disable_vf
authorNicholas Nunley <nicholas.d.nunley@intel.com>
Fri, 4 Jun 2021 16:48:54 +0000 (09:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:35 +0000 (09:48 +0100)
commit9ef6589cac9a8c47f5544ccdf4c498093733bb3f
treeecb5ce5fbbc28b31b9585ee53b5c5bde05ec4d7e
parentfb2be87cc330096e22348c0576beb7fef4fc7b4b
iavf: free q_vectors before queues in iavf_disable_vf

[ Upstream commit 89f22f129696ab53cfbc608e0a2184d0fea46ac1 ]

iavf_free_queues() clears adapter->num_active_queues, which
iavf_free_q_vectors() relies on, so swap the order of these two function
calls in iavf_disable_vf(). This resolves a panic encountered when the
interface is disabled and then later brought up again after PF
communication is restored.

Fixes: 65c7006f234c ("i40evf: assign num_active_queues inside i40evf_alloc_queues")
Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_main.c