mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacld-3.0: Fix memory allocation for zero channel list
Current driver try allocate memory when number of channel are passed as zero which will cause memory allocation failure. As part of the fix, when number of channels comes as zero then driver shouldn't allocate memory and let the firmware take care of it. CRs-Fixed: 1007196 Change-Id: I51d8a6decbe4c21265e88624e490446a48ea4857
This commit is contained in:
parent
b66fc73614
commit
eda6d7ec50
1 changed files with 7 additions and 7 deletions
|
|
@ -483,14 +483,14 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
|
|||
struct scan_start_params cmd = {0};
|
||||
tSirScanOffloadEvent *scan_event;
|
||||
|
||||
cmd.chan_list = qdf_mem_malloc(sizeof(uint32_t) *
|
||||
scan_req->channelList.numChannels);
|
||||
if (NULL == cmd.chan_list) {
|
||||
qdf_status = QDF_STATUS_E_NOMEM;
|
||||
goto error;
|
||||
if (scan_req->channelList.numChannels > 0) {
|
||||
cmd.chan_list = qdf_mem_malloc(sizeof(uint32_t) *
|
||||
scan_req->channelList.numChannels);
|
||||
if (NULL == cmd.chan_list) {
|
||||
qdf_status = QDF_STATUS_E_NOMEM;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
qdf_mem_zero((void *)cmd.chan_list, sizeof(uint32_t) *
|
||||
scan_req->channelList.numChannels);
|
||||
if (scan_req->sessionId > wma_handle->max_bssid) {
|
||||
WMA_LOGE("%s: Invalid vdev_id %d, msg_type : 0x%x", __func__,
|
||||
scan_req->sessionId, msg_type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue