diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2018-01-25 11:37:31 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-01-25 11:37:31 -0800 |
| commit | c3d005b001df5ecd1f16d8061b4e9d46e7b7866c (patch) | |
| tree | 4292d6d797a4801caa8c1e3d86386d0ecd6065d9 | |
| parent | 717bb7a529f71a3074aa29388f9e4a365308f8dc (diff) | |
| parent | 3889ccc1dae7ed4e9c21d3480303714a6942d0c8 (diff) | |
Merge "ASoC: wcd_cpe_core: add size check for WDSP ELF files"
| -rw-r--r-- | sound/soc/codecs/wcd_cpe_core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index 9218786f913f..c5c386067942 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * 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, goto done; } + if (phdr->p_filesz != split_fw->size) { + dev_err(core->dev, + "%s: %s size mismatch, phdr_size: 0x%x fw_size: 0x%zx", + __func__, split_fname, phdr->p_filesz, split_fw->size); + ret = -EINVAL; + goto done; + } + segment->cpe_addr = phdr->p_paddr; segment->size = phdr->p_filesz; segment->data = (u8 *) split_fw->data; |
