Skip to contentSkip to conversation

ASoC: wm_adsp: Fix crash in kunit tests on arm64

PATCH In review Charles Keepax 2 participants 2 messages Mar 18

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: wm_adsp: Fix crash in kunit tests on arm64

Several of the wm_adsp kunit tests failed by only on arm64. This turns out to be passing things to release_firmware which were not allocated with request_firmware. This does actually drop some errors on other platforms but somehow doesn't cause the tests to fail, and kunit hides a lot of the output for passing tests.

There is a comment in the code regarding this exact thing in wm_adsp_fw_find_test_case_exit(), but then it goes on and does it anyway. I suspect maybe there was a plan to override wm_adsp_release_firmware_files() that got forgotten, as the function appears to have hooks for kunit that aren't used. Anyway for now implement a simple fix of freeing the filenames locally. It is likely a more detailed fix will be implemented in the near future but this should get things moving again.

Fixes bf2d44d07de7 ("ASoC: wm_adsp: Add kunit test for firmware file search")
---
 sound/soc/codecs/wm_adsp_fw_find_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/wm_adsp_fw_find_test.c +2 -1
index 44c26e991b359..fb886dc61c27a 100644
@@ -262,7 +262,8 @@ static void wm_adsp_fw_find_test_case_exit(struct kunit *test)
 	 * dummies not allocated by the real request_firmware() call they
 	 * must not be passed to release_firmware().
 	 */
-	wm_adsp_release_firmware_files(&priv->found_fw);
+	kfree(priv->found_fw.wmfw.filename);
+	kfree(priv->found_fw.coeff.filename);
 }
 
 static void wm_adsp_fw_find_test_param_desc(const struct wm_adsp_fw_find_test_params *param,
Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 1 line · Charles Keepax

ASoC: wm_adsp: Fix crash in kunit tests on arm64

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1

Thanks!

[1/1] ASoC: wm_adsp: Fix crash in kunit tests on arm64

      https://git.kernel.org/broonie/sound/c/6017671da9d0

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark