Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2821011 authored by Johannes Berg's avatar Johannes Berg
Browse files

iwlwifi: mvm: sanity check context in iwl_mvm_phy_ctxt_unref()



In some botched (!) restart scenarios we seem to get here with
a NULL PHY context, so warn and exit instead of crashing.

Reported-by: default avatarOmer Kremer <omerx.kremer@intel.com>
Reviewed-by: default avatarIlan Peer <ilan.peer@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent afc66bb7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -245,5 +245,9 @@ int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt)
{
	lockdep_assert_held(&mvm->mutex);

	if (WARN_ON_ONCE(!ctxt))
		return;

	ctxt->ref--;
}