From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Colin Ian King <colin.i.king@gmail.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
sound-open-firmware@alsa-project.org,
linux-sound@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
Date: Tue, 2 Sep 2025 13:14:11 +0300 [thread overview]
Message-ID: <cb98f508-7ad1-4ed8-b366-7c2ed8951629@linux.intel.com> (raw)
In-Reply-To: <20250902083213.2620124-1-colin.i.king@gmail.com>
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
next prev parent reply other threads:[~2025-09-02 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-09-02 13:48 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb98f508-7ad1-4ed8-b366-7c2ed8951629@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=broonie@kernel.org \
--cc=colin.i.king@gmail.com \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox