Commit d712a344 authored by Kai Liu's avatar Kai Liu Committed by Madan Mohan Koyyalamudi
Browse files

qcacld-2.0: align psk with 4 bytes in wmi WMI_SAP_OFL_ENABLE_CMDID

In sap auth offload enabled case, if psk isn't 4 bytes aligned,
tlv check of WMI_SAP_OFL_ENABLE_CMDID will fail.

Change-Id: Icd6c437f8d7705262e8853b9c348f950b04790b5
CRs-Fixed: 903134
parent cbb47867
......@@ -21405,7 +21405,7 @@ static int wma_process_sap_auth_offload(tp_wma_handle wma_handle,
wmi_sap_ofl_enable_cmd_fixed_param *cmd = NULL;
wmi_buf_t buf;
u_int8_t *buf_ptr;
u_int16_t len, psk_len;
u_int16_t len, psk_len, psk_len_padded;
int err;
 
if (!WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
......@@ -21415,7 +21415,10 @@ static int wma_process_sap_auth_offload(tp_wma_handle wma_handle,
}
 
psk_len = sap_auth_offload_info->key_len;
len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + psk_len;
psk_len_padded = roundup(psk_len, sizeof(uint32_t));
len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + psk_len_padded;
buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
if (!buf) {
WMA_LOGE("Failed to allocate buffer to send "
......@@ -21453,7 +21456,7 @@ static int wma_process_sap_auth_offload(tp_wma_handle wma_handle,
}
 
buf_ptr += sizeof(wmi_sap_ofl_enable_cmd_fixed_param);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, psk_len);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, psk_len_padded);
buf_ptr += WMI_TLV_HDR_SIZE;
vos_mem_copy(buf_ptr, sap_auth_offload_info->key, psk_len);
 
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment