diff options
| author | Richard Fitzgerald <[email protected]> | 2025-04-10 13:21:29 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2025-04-10 13:47:14 +0000 |
| commit | 285b2c74cf9982e873ef82a2cb1328d9e9406f65 (patch) | |
| tree | 275e9cd417f6d4d5099dea52194ea96882636a3b /drivers/fpga/tests/fpga-bridge-test.c | |
| parent | ASoC: codecs: Add of_match_table for aw888081 driver (diff) | |
| download | kernel-285b2c74cf9982e873ef82a2cb1328d9e9406f65.tar.gz kernel-285b2c74cf9982e873ef82a2cb1328d9e9406f65.zip | |
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: cd8c058499b6 ("firmware: cs_dsp: Add KUnit testing of bin error cases")
Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-bridge-test.c')
0 files changed, 0 insertions, 0 deletions
