qcacmn: Add NULL checks before dereferencing

Add NULL checks before dereferencing in:
1) HIF layer
2) WMI layer.

Change-Id: I47c5d18ae7841826d958d742283edb0bd6d246b7
CRs-Fixed: 1036390
This commit is contained in:
Himanshu Agarwal
2016-06-30 18:04:14 +05:30
committed by Nandini Suresh
parent 224a7313f3
commit ac3869bf63

View File

@@ -5887,6 +5887,11 @@ QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle,
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
WMI_LOGE("%s: buf allocation failed", __func__);
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *) wmi_buf_data(buf);
qdf_mem_zero(buf_ptr, len);
cmd = (wmi_request_link_stats_cmd_fixed_param *) buf_ptr;