From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: broonie@kernel.org
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH] ASoC: wm_adsp_fw_find_test: Fix missing NULL terminator on file name list
Date: Thu, 26 Mar 2026 10:08:53 +0000 [thread overview]
Message-ID: <20260326100853.1582886-1-rf@opensource.cirrus.com> (raw)
The array wm_adsp_fw_find_test_dir_all_files[] needs a NULL terminator.
It was documented at line 41 that dir_files points to a NULL-terminated
array.
/* NULL-terminated array of pointers to filenames ... <snip> */
const char * const *dir_files;
This fixes the error reported by KASAN:
[17:46:43] BUG: KASAN: global-out-of-bounds in
wm_adsp_fw_find_test_pick_file+0x8cc/0xc80
[17:46:43] Read of size 8 at addr ffff800081e5ffe8 by task
kunit_try_catch/18349
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: bf2d44d07de7 ("ASoC: wm_adsp: Add kunit test for firmware file search")
---
sound/soc/codecs/wm_adsp_fw_find_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/wm_adsp_fw_find_test.c b/sound/soc/codecs/wm_adsp_fw_find_test.c
index fb886dc61c27..d0c7fb30a95d 100644
--- a/sound/soc/codecs/wm_adsp_fw_find_test.c
+++ b/sound/soc/codecs/wm_adsp_fw_find_test.c
@@ -1041,6 +1041,7 @@ static const char * const wm_adsp_fw_find_test_dir_all_files[] = {
"cirrus/cs1234-dsp1-mbc-vss.bin",
"cirrus/wm1234-dsp1-mbc-vss.bin",
"wm1234-dsp1-mbc-vss.bin",
+ NULL /* terminator */
};
/*
--
2.47.3
next reply other threads:[~2026-03-26 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 10:08 Richard Fitzgerald [this message]
2026-03-26 10:44 ` [PATCH] ASoC: wm_adsp_fw_find_test: Fix missing NULL terminator on file name list Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260326100853.1582886-1-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox