[PATCH] wifi: brcmfmac: fix P2P action frame handling without device vif

Jason Huang posted 1 patch 2 days, 14 hours ago
drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] wifi: brcmfmac: fix P2P action frame handling without device vif
Posted by Jason Huang 2 days, 14 hours ago
From: Jason Huang <jason.huang2@infineon.com>

Some P2P action frame paths assume the P2P device vif is always
available. That is not true when userspace sends non-P2P public action
frames through the primary interface, or when action-frame abort runs
after the P2P device vif has not been created.

Fall back to the primary vif when aborting an action frame without a P2P
device vif, and guard P2P device saved IE access before using it for
peer channel search.

Fixes: 30fb1b272909 ("brcmfmac: use actframe_abort to cancel ongoing action frame")
Fixes: 6eda4e2c5425 ("brcmfmac: Add tx p2p off-channel support.")

Signed-off-by: Jason Huang <jason.huang2@infineon.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index 92c16a317328..66557be28e7b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -1283,6 +1283,9 @@ static s32 brcmf_p2p_abort_action_frame(struct brcmf_cfg80211_info *cfg)
 	brcmf_dbg(TRACE, "Enter\n");
 
 	vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
+	if (!vif)
+		vif = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
+
 	err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
 					sizeof(s32));
 	if (err)
@@ -1819,6 +1822,7 @@ bool brcmf_p2p_send_action_frame(struct brcmf_if *ifp,
 	/* validate channel and p2p ies */
 	if (config_af_params.search_channel &&
 	    IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
+	    p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif &&
 	    p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif->saved_ie.probe_req_ie_len) {
 		afx_hdl = &p2p->afx_hdl;
 		afx_hdl->peer_listen_chan = le32_to_cpu(af_params->channel);
-- 
2.25.1
Re: [PATCH] wifi: brcmfmac: fix P2P action frame handling without device vif
Posted by Johannes Berg 2 days, 13 hours ago
On Wed, 2026-07-22 at 16:26 +0800, Jason Huang wrote:
> 
> Fixes: 30fb1b272909 ("brcmfmac: use actframe_abort to cancel ongoing action frame")
> Fixes: 6eda4e2c5425 ("brcmfmac: Add tx p2p off-channel support.")
> 
> Signed-off-by: Jason Huang <jason.huang2@infineon.com>

I feel like I might have fixed that for you last time, but there
shouldn't be a blank line here, please change it in the future.

johannes