[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb98f508-7ad1-4ed8-b366-7c2ed8951629@linux.intel.com>
Date: Tue, 2 Sep 2025 13:14:11 +0300
From: Péter Ujfalusi <peter.ujfalusi@...ux.intel.com>
To: Colin Ian King <colin.i.king@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Daniel Baluta <daniel.baluta@....com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, sound-open-firmware@...a-project.org,
linux-sound@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero
check on a u32
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@...il.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@...ux.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
Powered by blists - more mailing lists