qcacld-3.0: Fix potential static code analysis issues

Fix potential null pointer access during sap open
session and validation of the session id which could
be reported during static code analysis.

Change-Id: I6146c7223c586df06c08c76abd9e38a3c1ad1c4b
CRs-Fixed: 979960
This commit is contained in:
Chandrasekaran, Manishekar 2016-02-22 22:21:10 +05:30 • committed by Vishwajith Upendra
commit d3cb4778fe
2 changed files with 9 additions and 1 deletions

View file

@ -201,6 +201,12 @@ QDF_STATUS wlansap_start(void *pCtx, enum tQDF_ADAPTER_MODE mode,
}
hal = (tHalHandle) CDS_GET_HAL_CB(pSapCtx->p_cds_gctx);
if (!hal) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
"%s: Invalid HAL pointer", __func__);
return QDF_STATUS_E_INVAL;
}
qdf_ret_status = sap_open_session(hal, pSapCtx, session_id);
if (QDF_STATUS_SUCCESS != qdf_ret_status) {

View file

@ -15130,7 +15130,9 @@ bool sme_is_session_id_valid(tHalHandle hal, uint32_t session_id)
{
tpAniSirGlobal mac = PMAC_STRUCT(hal);
if (!mac) {
sms_log(mac, LOGE, FL("null mac pointer"));
/* Using QDF_TRACE since mac is not available for sms_log */
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: null mac pointer", __func__);
return false;
}