diff options
author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2025-04-10 16:21:29 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-04-10 16:47:14 +0300 |
commit | 285b2c74cf9982e873ef82a2cb1328d9e9406f65 (patch) | |
tree | 275e9cd417f6d4d5099dea52194ea96882636a3b /tools/perf/scripts/python/intel-pt-events.py | |
parent | 6bbb2b1286f437b45ccf4828a537429153cd1096 (diff) | |
download | linux-285b2c74cf9982e873ef82a2cb1328d9e9406f65.tar.xz |
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 <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250410132129.1312541-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/intel-pt-events.py')
0 files changed, 0 insertions, 0 deletions