linux/drivers/firmware/cirrus/test
Richard Fitzgerald 285b2c74cf
firmware: cs_dsp: test_bin_error: Fix uninitialized data used as fw version
Call cs_dsp_mock_xm_header_get_fw_version() to get the firmware version
from the dummy XM header data in cs_dsp_bin_err_test_common_init().

Make the same change to cs_dsp_bin_test_common_init() and remove the
cs_dsp_mock_xm_header_get_fw_version_from_regmap() function.

The code in cs_dsp_test_bin.c was correctly calling
cs_dsp_mock_xm_header_get_fw_version_from_regmap() to fetch the fw version
from a dummy header it wrote to XM registers. However in
cs_dsp_test_bin_error.c the test doesn't stuff a dummy header into XM, it
populates it the normal way using a wmfw file. It should have called
cs_dsp_mock_xm_header_get_fw_version() to get the data from its blob
buffer, but was calling cs_dsp_mock_xm_header_get_fw_version_from_regmap().
As nothing had been written to the registers this returned the value of
uninitialized data.

The only other use of cs_dsp_mock_xm_header_get_fw_version_from_regmap()
was cs_dsp_test_bin.c, but it doesn't need to use it. It already has a
blob buffer containing the dummy XM header so it can use
cs_dsp_mock_xm_header_get_fw_version() to read from that.

Fixes: cd8c058499 ("firmware: cs_dsp: Add KUnit testing of bin error cases")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250410132129.1312541-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-10 14:47:14 +01:00
..
Makefile firmware: cs_dsp: Add KUnit testing of client callbacks 2024-12-13 13:14:48 +00:00
cs_dsp_mock_bin.c firmware: cs_dsp: Fix kerneldoc typos in cs_dsp_mock_bin.c 2024-12-16 12:31:27 +00:00
cs_dsp_mock_mem_maps.c firmware: cs_dsp: test_bin_error: Fix uninitialized data used as fw version 2025-04-10 14:47:14 +01:00
cs_dsp_mock_regmap.c
cs_dsp_mock_utils.c
cs_dsp_mock_wmfw.c firmware: cs_dsp: Fix endianness conversion in cs_dsp_mock_wmfw.c 2024-12-17 13:27:40 +00:00
cs_dsp_test_bin.c firmware: cs_dsp: test_bin_error: Fix uninitialized data used as fw version 2025-04-10 14:47:14 +01:00
cs_dsp_test_bin_error.c firmware: cs_dsp: test_bin_error: Fix uninitialized data used as fw version 2025-04-10 14:47:14 +01:00
cs_dsp_test_callbacks.c firmware: cs_dsp: Add KUnit testing of client callbacks 2024-12-13 13:14:48 +00:00
cs_dsp_test_control_cache.c firmware: cs_dsp: Add KUnit testing of control cache 2024-12-13 13:14:44 +00:00
cs_dsp_test_control_parse.c firmware: cs_dsp: test_control_parse: null-terminate test strings 2025-02-19 23:08:31 +00:00
cs_dsp_test_control_rw.c firmware: cs_dsp: Add KUnit testing of control read/write 2024-12-13 13:14:45 +00:00
cs_dsp_test_wmfw.c firmware: cs_dsp: Add KUnit testing of wmfw download 2024-12-13 13:14:42 +00:00
cs_dsp_test_wmfw_error.c firmware: cs_dsp: Add KUnit testing of wmfw error cases 2024-12-13 13:14:47 +00:00
cs_dsp_tests.c firmware: cs_dsp: Add KUnit testing of bin file download 2024-12-13 13:14:41 +00:00