* [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
@ 2025-09-02 8:32 Colin Ian King
2025-09-02 10:14 ` Péter Ujfalusi
2025-09-02 13:48 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2025-09-02 8:32 UTC (permalink / raw)
To: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
Jaroslav Kysela, Takashi Iwai, sound-open-firmware, linux-sound
Cc: kernel-janitors, linux-kernel
Currently the error check from the call to sof_ipc4_get_sample_type
is always false because a u32 variable out_ref_type is being used
to perform the less than zero check. Fix this by using the int
variable ret to perform the check.
Fixes: c04c2e829649 ("ASoC: SOF: ipc4-topology: Add support for 8-bit formats")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
sound/soc/sof/ipc4-topology.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index f5e62cd8fc0c..b6a732d0adb4 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -2191,9 +2191,10 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
case snd_soc_dapm_dai_in:
out_ref_rate = params_rate(fe_params);
out_ref_channels = params_channels(fe_params);
- out_ref_type = sof_ipc4_get_sample_type(sdev, fe_params);
- if (out_ref_type < 0)
- return out_ref_type;
+ ret = sof_ipc4_get_sample_type(sdev, fe_params);
+ if (ret < 0)
+ return ret;
+ out_ref_type = (u32)ret;
if (!single_output_bitdepth) {
out_ref_valid_bits = sof_ipc4_get_valid_bits(sdev, fe_params);
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
2025-09-02 8:32 [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32 Colin Ian King
@ 2025-09-02 10:14 ` Péter Ujfalusi
2025-09-02 13:48 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2025-09-02 10:14 UTC (permalink / raw)
To: Colin Ian King, Liam Girdwood, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
Jaroslav Kysela, Takashi Iwai, sound-open-firmware, linux-sound
Cc: kernel-janitors, linux-kernel
On 02/09/2025 11:32, Colin Ian King wrote:
> Currently the error check from the call to sof_ipc4_get_sample_type
> is always false because a u32 variable out_ref_type is being used
> to perform the less than zero check. Fix this by using the int
> variable ret to perform the check.
>
> Fixes: c04c2e829649 ("ASoC: SOF: ipc4-topology: Add support for 8-bit formats")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ---
> sound/soc/sof/ipc4-topology.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
> index f5e62cd8fc0c..b6a732d0adb4 100644
> --- a/sound/soc/sof/ipc4-topology.c
> +++ b/sound/soc/sof/ipc4-topology.c
> @@ -2191,9 +2191,10 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
> case snd_soc_dapm_dai_in:
> out_ref_rate = params_rate(fe_params);
> out_ref_channels = params_channels(fe_params);
> - out_ref_type = sof_ipc4_get_sample_type(sdev, fe_params);
> - if (out_ref_type < 0)
> - return out_ref_type;
> + ret = sof_ipc4_get_sample_type(sdev, fe_params);
> + if (ret < 0)
> + return ret;
> + out_ref_type = (u32)ret;
>
> if (!single_output_bitdepth) {
> out_ref_valid_bits = sof_ipc4_get_valid_bits(sdev, fe_params);
--
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
2025-09-02 8:32 [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32 Colin Ian King
2025-09-02 10:14 ` Péter Ujfalusi
@ 2025-09-02 13:48 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-09-02 13:48 UTC (permalink / raw)
To: Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
Daniel Baluta, Kai Vehmanen, Pierre-Louis Bossart,
Jaroslav Kysela, Takashi Iwai, sound-open-firmware, linux-sound,
Colin Ian King
Cc: kernel-janitors, linux-kernel
On Tue, 02 Sep 2025 09:32:13 +0100, Colin Ian King wrote:
> Currently the error check from the call to sof_ipc4_get_sample_type
> is always false because a u32 variable out_ref_type is being used
> to perform the less than zero check. Fix this by using the int
> variable ret to perform the check.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
commit: 3279052eab235bfb7130b1fabc74029c2260ed8d
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] 3+ messages in thread
end of thread, other threads:[~2025-09-02 13:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 8:32 [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32 Colin Ian King
2025-09-02 10:14 ` Péter Ujfalusi
2025-09-02 13:48 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).