qcacmn: Add memory corruption check
Do not allocate memory if the ask is larger than the maximum memory allowed for malloc. We have it limited to 4MB. CRs-Fixed: 2828104 Change-Id: I5b463dd8eb640c76882653e82e6f6db7cb651cf2
This commit is contained in:
@@ -1780,6 +1780,12 @@ void *qdf_mem_malloc_atomic_fl(size_t size, const char *func, uint32_t line)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
if (!size || size > QDF_MEM_MAX_MALLOC) {
|
||||
qdf_nofl_err("Cannot malloc %zu bytes @ %s:%d", size, func,
|
||||
line);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = qdf_mem_prealloc_get(size);
|
||||
if (ptr)
|
||||
return ptr;
|
||||
|
Reference in New Issue
Block a user