qcacld-3.0: Fix Suspicious pointer dereference before NULL check

qcacld-2.0 to qcacld-3.0 propagation

Fix to add NULL check before dereference of pointer

Change-Id: I520aca1fc46cf3fbb30d2f068f6da43a2b2986e6
CRs-Fixed: 965800
This commit is contained in:
Sreelakshmi Konamki 2016-02-10 12:33:40 +05:30 • committed by Gerrit - the friendly Code Review server
commit 86d79203a7
2 changed files with 3 additions and 3 deletions

View file

@ -209,8 +209,7 @@ QDF_STATUS oem_data_send_mb_oem_data_req(tpAniSirGlobal pMac,
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tSirOemDataReq *pMsg;
tCsrRoamSession *pSession =
CSR_GET_SESSION(pMac, pOemDataReq->sessionId);
tCsrRoamSession *pSession;
uint16_t msgLen;
sms_log(pMac, LOGW, "OEM_DATA: entering Function %s", __func__);
@ -220,6 +219,7 @@ QDF_STATUS oem_data_send_mb_oem_data_req(tpAniSirGlobal pMac,
return QDF_STATUS_E_INVAL;
}
pSession = CSR_GET_SESSION(pMac, pOemDataReq->sessionId);
pMsg = qdf_mem_malloc(sizeof(*pMsg));
if (NULL == pMsg) {
sms_log(pMac, LOGP, FL("qdf_mem_malloc failed"));

View file

@ -1506,7 +1506,7 @@ void wma_start_oem_data_req(tp_wma_handle wma_handle,
WMA_LOGD(FL("Send OEM Data Request to target"));
if (!startOemDataReq && !startOemDataReq->data) {
if (!startOemDataReq || !startOemDataReq->data) {
WMA_LOGE(FL("startOemDataReq is null"));
goto out;
}