mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
qcacld-3.0: Add memory allocation failure check for BPF instructions
Add check for BPF instructions memory allocation failure and fail the request gracefully if memory allocation fails. Change-Id: Ifa6cab73c59aa4a7c587fa0b7d38e9b8523a3b1c CRs-Fixed: 1047209
This commit is contained in:
parent
e5a1682c3e
commit
348ed99339
1 changed files with 6 additions and 0 deletions
|
|
@ -15754,6 +15754,12 @@ QDF_STATUS sme_set_bpf_instructions(tHalHandle hal,
|
|||
if (set_offload->total_length) {
|
||||
set_offload->program = qdf_mem_malloc(sizeof(uint8_t) *
|
||||
req->current_length);
|
||||
if (NULL == set_offload->program) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Failed to alloc instruction memory"));
|
||||
qdf_mem_free(set_offload);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
qdf_mem_copy(set_offload->program, req->program,
|
||||
set_offload->current_length);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue