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

Commit 8c92245a authored by Gururaj Pandurangi's avatar Gururaj Pandurangi Committed by snandini
Browse files

qcacld-3.0: Validate pProfile before dereferencing it

Add sanity check for pProfile pointer before
dereferencing it in csr api.

Change-Id: I7290a46aea92f0c77c1123143c994cc684e26744
CRs-Fixed: 2775360
parent a22921e7
Loading
Loading
Loading
Loading
+27 −24
Original line number Diff line number Diff line
@@ -1957,6 +1957,11 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
	uint32_t bitMask, loopCount;
	uint32_t bss_chan_freq;

	if (!pProfile) {
		sme_err("profile not found");
		return fMatch;
	}

	if (!QDF_IS_STATUS_SUCCESS(csr_get_phy_mode_from_bss(mac, pSirBssDesc,
					&phyModeInBssDesc, pIes)))
		return fMatch;
@@ -2019,7 +2024,6 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
	cfgDot11ModeToUse = csr_get_vdev_dot11_mode(mac, pProfile->csrPersona,
						    cfgDot11ModeToUse);
	if (fMatch && pReturnCfgDot11Mode) {
		if (pProfile) {
		/*
		 * IEEE 11n spec (8.4.3): HT STA shall
		 * eliminate TKIP as a choice for the pairwise
@@ -2044,7 +2048,6 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode,
					eCSR_CFG_DOT11_MODE_11A;
			}
		}
		}
		*pReturnCfgDot11Mode = cfgDot11ModeToUse;
	}