Skip to content

Commit 6b4ba96

Browse files
lnxbuildGerrit - the friendly Code Review server
authored and
Gerrit - the friendly Code Review server
committed
Merge "ASoC: wcd_cpe_core: add size check for WDSP ELF files"
2 parents 0603777 + 94016e8 commit 6b4ba96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sound/soc/codecs/wcd_cpe_core.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
1+
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License version 2 and
@@ -337,6 +337,14 @@ static int wcd_cpe_load_each_segment(struct wcd_cpe_core *core,
337337
goto done;
338338
}
339339

340+
if (phdr->p_filesz != split_fw->size) {
341+
dev_err(core->dev,
342+
"%s: %s size mismatch, phdr_size: 0x%x fw_size: 0x%zx",
343+
__func__, split_fname, phdr->p_filesz, split_fw->size);
344+
ret = -EINVAL;
345+
goto done;
346+
}
347+
340348
segment->cpe_addr = phdr->p_paddr;
341349
segment->size = phdr->p_filesz;
342350
segment->data = (u8 *) split_fw->data;

0 commit comments

Comments
 (0)