ASoC: SOF: ipc4-topology: Return error for invalid number of formats
Subsystems (3)
PATCH 1/1 ASoC: SOF: ipc4-topology: Return error for invalid number of formats
When the number of input or output formats is zero, sof_ipc4_widget_setup_comp_src() and sof_ipc4_widget_setup_comp_asrc() print an error and jump to the cleanup label. At that point 'ret' is still 0, because the earlier sof_ipc4_get_audio_fmt() call succeeded, so the function returns success and the caller never finds out that the widget setup actually failed.
Set ret to -EINVAL before the goto so the error gets reported.
--- sound/soc/sof/ipc4-topology.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/sof/ipc4-topology.c +2 -0
@@ -1127,6 +1127,7 @@ static int sof_ipc4_widget_setup_comp_src(struct snd_sof_widget *swidget)"Invalid number of formats: input: %d, output: %d\n" , src->available_fmt.num_input_formats, src->available_fmt.num_output_formats); + ret = -EINVAL ; goto err; }
@@ -1179,6 +1180,7 @@ static int sof_ipc4_widget_setup_comp_asrc(struct snd_sof_widget *swidget)"Invalid number of formats: input: %d, output: %d\n" , asrc->available_fmt.num_input_formats, asrc->available_fmt.num_output_formats); + ret = -EINVAL ; goto err; }
Signature · 1 line
2.54.0
Mark Brown
maintainerQuoted 1 line · Mert Seftali
ASoC: SOF: ipc4-topology: Return error for invalid number of formats
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/1] ASoC: SOF: ipc4-topology: Return error for invalid number of formats
https://git.kernel.org/broonie/sound/c/11e828cd6b0f
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