Search Linux Wireless

[PATCH] wifi: brcmfmac: handle possible IE flags reset error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In 'brcmf_vif_clear_mgmt_ies()', check for possible error returned
by 'brcmf_vif_set_mgmt_ie()' and issue appropriate message if needed.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
---
 .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 9012456e1a18..cfa5fdd039fe 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -4999,15 +4999,23 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
 
 s32 brcmf_vif_clear_mgmt_ies(struct brcmf_cfg80211_vif *vif)
 {
+	struct brcmf_pub *drvr = vif->ifp->drvr;
 	static const s32 pktflags[] = {
 		BRCMF_VNDR_IE_PRBREQ_FLAG,
 		BRCMF_VNDR_IE_PRBRSP_FLAG,
 		BRCMF_VNDR_IE_BEACON_FLAG
 	};
+	s32 err;
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(pktflags); i++)
-		brcmf_vif_set_mgmt_ie(vif, pktflags[i], NULL, 0);
+	for (i = 0; i < ARRAY_SIZE(pktflags); i++) {
+		err = brcmf_vif_set_mgmt_ie(vif, pktflags[i], NULL, 0);
+		if (err) {
+			bphy_err(drvr, "Clear IE %d failed (error %d)\n",
+				 pktflags[i], err);
+			return err;
+		}
+	}
 
 	memset(&vif->saved_ie, 0, sizeof(vif->saved_ie));
 	return 0;
-- 
2.41.0




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux