* [PATCH] ASoC: SOF: ipc4-topology: Return error for invalid number of formats
@ 2026-06-14 12:40 Mert Seftali
2026-06-29 15:23 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Mert Seftali @ 2026-06-14 12:40 UTC (permalink / raw)
To: Peter Ujfalusi, Liam Girdwood, Mark Brown
Cc: Bard Liao, Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart,
sound-open-firmware, linux-sound, linux-kernel, Mert Seftali,
kernel test robot, Dan Carpenter
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.
Fixes: 21a5adffad46 ("ASoC: SOF: ipc4-topology: Validate the number of in/out formats for src/asrc")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202606111431.Uky3T0tF-lkp@intel.com/
Signed-off-by: Mert Seftali <mertsftl@gmail.com>
---
sound/soc/sof/ipc4-topology.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 95ad5266b0c6..8ac7dde32f77 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -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;
}
--
2.54.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: SOF: ipc4-topology: Return error for invalid number of formats
2026-06-14 12:40 [PATCH] ASoC: SOF: ipc4-topology: Return error for invalid number of formats Mert Seftali
@ 2026-06-29 15:23 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-29 15:23 UTC (permalink / raw)
To: Peter Ujfalusi, Liam Girdwood, Mert Seftali
Cc: Bard Liao, Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart,
sound-open-firmware, linux-sound, linux-kernel,
kernel test robot, Dan Carpenter
On Sun, 14 Jun 2026 14:40:19 +0200, Mert Seftali wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-30 11:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-14 12:40 [PATCH] ASoC: SOF: ipc4-topology: Return error for invalid number of formats Mert Seftali
2026-06-29 15:23 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox