diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-02-11 16:00:02 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-02-19 23:08:31 +0000 |
commit | 42ae6e2559e63c2d4096b698cd47aaeb974436df (patch) | |
tree | e54c5ed06e4ac7689d15afe5a2d3e24d9656466c /tools/perf/scripts/python/syscall-counts.py | |
parent | 2e2f89b184644f0e29f1ec0b4dcfd0361d2635cb (diff) |
firmware: cs_dsp: test_control_parse: null-terminate test strings
The char pointers in 'struct cs_dsp_mock_coeff_def' are expected to
point to C strings. They need to be terminated by a null byte.
However the code does not allocate that trailing null byte and only
works if by chance the allocation is followed by such a null byte.
Refactor the repeated string allocation logic into a new helper which
makes sure the terminating null is always present.
It also makes the code more readable.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Fixes: 83baecd92e7c ("firmware: cs_dsp: Add KUnit testing of control parsing")
Cc: stable@vger.kernel.org
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250211-cs_dsp-kunit-strings-v1-1-d9bc2035d154@linutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions