]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: cs_dsp: Return error if block header overflows file
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 27 Jun 2024 14:14:30 +0000 (15:14 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 1 Jul 2024 13:10:23 +0000 (14:10 +0100)
commit959fe01e85b7241e3ec305d657febbe82da16a02
treea57a164bd4565969259a9a59b9bfbc4835a018d4
parent3019b86bce16fbb5bc1964f3544d0ce7d0137278
firmware: cs_dsp: Return error if block header overflows file

Return an error from cs_dsp_power_up() if a block header is longer
than the amount of data left in the file.

The previous code in cs_dsp_load() and cs_dsp_load_coeff() would loop
while there was enough data left in the file for a valid region. This
protected against overrunning the end of the file data, but it didn't
abort the file processing with an error.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: f6bc909e7673 ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Link: https://patch.msgid.link/20240627141432.93056-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/firmware/cirrus/cs_dsp.c