mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiale Yao <yaojiale02@163.com>
To: Miri Korenblit <miriam.rachel.korenblit@intel.com>,
	Ilan Peer <ilan.peer@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 2/4] wifi: iwlwifi: mvm: clear P2P device pointer on add failure
Date: Wed, 28 Oct 2026 13:03:35 +0800	[thread overview]
Message-ID: <20261028050337.127464-3-yaojiale02@163.com> (raw)
In-Reply-To: <20261028050337.127464-1-yaojiale02@163.com>

The MLD add_interface path publishes p2p_device_vif before updating power
configuration. If that update fails, the remaining interface state is
unwound but the pointer still refers to the vif that mac80211 will free.

Clear the P2P device pointer before entering the common cleanup path.

Fixes: 84ef7cbe90e9 ("wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index 6ea9a7c8da0c..b1d4419a236c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -74,8 +74,11 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
 		mvm->p2p_device_vif = vif;
 
 	ret = iwl_mvm_power_update_mac(mvm);
-	if (ret)
+	if (ret) {
+		if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
+			mvm->p2p_device_vif = NULL;
 		goto out_free_bf;
+	}
 
 	iwl_mvm_tcm_add_vif(mvm, vif);
 
-- 
2.34.1


  parent reply	other threads:[~2026-10-28  5:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28  5:03 [PATCH 0/4] wifi: unwind failed interface setup and recovery Jiale Yao
2026-10-28  5:03 ` [PATCH 1/4] wifi: ath10k: clear monitor interface after add failure Jiale Yao
2026-10-28  5:03 ` Jiale Yao [this message]
2026-10-28  5:03 ` [PATCH 3/4] wifi: mt76: mt7921: unwind interface restore failures Jiale Yao
2026-10-28  5:03 ` [PATCH 4/4] wifi: mt76: mt7925: unwind link " Jiale Yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261028050337.127464-3-yaojiale02@163.com \
    --to=yaojiale02@163.com \
    --cc=gregory.greenman@intel.com \
    --cc=ilan.peer@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®