diff options
author | Mark Brown <broonie@kernel.org> | 2019-10-02 14:50:40 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-02 14:50:40 +0300 |
commit | 25317997cbcd0497a9460f79c322e0fde0b5b1a9 (patch) | |
tree | 215512440bd5a9ce931789d7c0f24d47e7c5d572 /sound/soc/sof/intel/byt.c | |
parent | 3a9e204d4e36904a464a2e53206b053a7ffc7bad (diff) | |
parent | 2bdf194e2030fce4f2e91300817338353414ab3b (diff) | |
download | linux-25317997cbcd0497a9460f79c322e0fde0b5b1a9.tar.xz |
Merge branch 'asoc-5.4' into asoc-5.5
Diffstat (limited to 'sound/soc/sof/intel/byt.c')
-rw-r--r-- | sound/soc/sof/intel/byt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index ecbc9c79bcad..b2597ecfdc1c 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -28,6 +28,7 @@ #define MBOX_OFFSET 0x144000 #define MBOX_SIZE 0x1000 #define EXCEPT_OFFSET 0x800 +#define EXCEPT_MAX_HDR_SIZE 0x400 /* DSP peripherals */ #define DMAC0_OFFSET 0x098000 @@ -126,6 +127,11 @@ static void byt_get_registers(struct snd_sof_dev *sdev, /* note: variable AR register array is not read */ /* then get panic info */ + if (xoops->arch_hdr.totalsize > EXCEPT_MAX_HDR_SIZE) { + dev_err(sdev->dev, "invalid header size 0x%x. FW oops is bogus\n", + xoops->arch_hdr.totalsize); + return; + } offset += xoops->arch_hdr.totalsize; sof_mailbox_read(sdev, offset, panic_info, sizeof(*panic_info)); |