idpf: prevent deinit uninitialized virtchnl core
authorAlan Brady <alan.brady@intel.com>
Thu, 22 Feb 2024 19:04:39 +0000 (11:04 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 4 Mar 2024 17:47:33 +0000 (09:47 -0800)
commit14696ed173af247a2d80b779c2f0cb08c94dfb4d
treef584e2fdad20a02fdaa50998c19fda075a0f710d
parentbcbedf253e918bcba8df999d300c3336e96fabff
idpf: prevent deinit uninitialized virtchnl core

In idpf_remove we need to tear down the virtchnl core with
idpf_vc_core_deinit so we can free up resources and leave things in a
good state. However, in the case where we failed to establish VC
communications we may not have ever actually successfully initialized
the virtchnl core.

This fixes it by setting a bit once we successfully init the virtchnl
core.  Then, in deinit, we'll check for it before going on further,
otherwise we just return. Also clear the bit at the end of deinit so we
know it's gone now.

Tested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/idpf/idpf.h
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c