]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: SOF: ipc4-topology: Fix a less than zero check on a u32
authorColin Ian King <colin.i.king@gmail.com>
Tue, 2 Sep 2025 08:32:13 +0000 (09:32 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 2 Sep 2025 10:23:46 +0000 (11:23 +0100)
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>
Link: https://patch.msgid.link/20250902083213.2620124-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c

index f5e62cd8fc0cb443174e5348fbf655a6d0fa64a1..b6a732d0adb4b7be8b73a9e51278ea11744c1611 100644 (file)
@@ -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);