wlan: fix unsafe code after VOS_ASSERT
The WLAN module extensively uses the VOS_ASSERT macro, which either does
nothing or emits a warning (depending on conditional compilation) and
continues, i.e. it does not abort. Use of VOS_ASSERT is unsafe in
instances where the assert performs out-of-bounds or NULL pointer
checks.
Patch takes care to bailout where ever it is unsafe to continue.
Change-Id: Ida1b72f4292f0b5d30b307b5ee43748e4af99a78
CRs-Fixed: 556307
diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c
index 40968ad..38af33e 100644
--- a/CORE/HDD/src/wlan_hdd_ftm.c
+++ b/CORE/HDD/src/wlan_hdd_ftm.c
@@ -1203,8 +1203,13 @@
VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_INFO,
"vos prestart");
-
- VOS_ASSERT( NULL != pVosContext->pWDAContext);
+ if (NULL == pVosContext->pWDAContext)
+ {
+ VOS_ASSERT(0);
+ VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
+ "%s: WDA NULL context", __func__);
+ return VOS_STATUS_E_FAILURE;
+ }
/* call macPreStart */
vStatus = macPreStart(pVosContext->pMACContext);