mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacmn: Add null pointer check
Add a null pointer check after allocating memory for storing the FFT bins. CRs-Fixed: 2673564 Change-Id: I1c55256a1bed921b2272e01a014808b4396bf193
This commit is contained in:
parent
0608b9dfbe
commit
6392e1b119
1 changed files with 8 additions and 0 deletions
|
|
@ -1430,6 +1430,10 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||
uint32_t *binptr_32 = (uint32_t *)&p_fft_report->buf;
|
||||
|
||||
fft_bin_buf = (uint8_t *)qdf_mem_malloc(MAX_NUM_BINS);
|
||||
if (!fft_bin_buf) {
|
||||
spectral_err("Failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
for (idx = 0; idx < fft_bin_count; idx++)
|
||||
fft_bin_buf[idx] = *(binptr_32++);
|
||||
} else if (spectral->len_adj_swar.fftbin_size_war ==
|
||||
|
|
@ -1437,6 +1441,10 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||
uint16_t *binptr_16 = (uint16_t *)&p_fft_report->buf;
|
||||
|
||||
fft_bin_buf = (uint8_t *)qdf_mem_malloc(MAX_NUM_BINS);
|
||||
if (!fft_bin_buf) {
|
||||
spectral_err("Failed to allocate memory");
|
||||
return;
|
||||
}
|
||||
for (idx = 0; idx < fft_bin_count; idx++)
|
||||
fft_bin_buf[idx] = *(binptr_16++);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue