]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: Intel: avs: Fix return status of avs_pcm_hw_constraints_init()
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Thu, 10 Oct 2024 11:20:08 +0000 (13:20 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 10 Oct 2024 16:03:07 +0000 (17:03 +0100)
Check for return code from avs_pcm_hw_constraints_init() in
avs_dai_fe_startup() only checks if value is different from 0. Currently
function can return positive value, change it to return 0 on success.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
--

I've observed KASAN on our setups and while patch itself is correct
regardless. Problem seems to be caused by recent changes to rates, as
this started happening after recent patchsets and doesn't reproduce with
those reverted
https://lore.kernel.org/linux-sound/20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com/
https://lore.kernel.org/linux-sound/20240911135756.24434-1-tiwai@suse.de/
I've tested using Mark tree, where they are both applied and for some
reason snd_pcm_hw_constraint_minmax() started returning positive value,
while previously it returned 0. I'm bit worried if it signals some
potential deeper problem regarding constraints with above changes.

Link: https://patch.msgid.link/20241010112008.545526-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/pcm.c

index afc0fc74cf9419f973c40314e6f302f23fcb9c1b..b37b6eeaf86afcbb29332f3c5a7f6e31b20df452 100644 (file)
@@ -490,7 +490,7 @@ static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
                            SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS,
                            SNDRV_PCM_HW_PARAM_RATE, -1);
 
-       return ret;
+       return 0;
 }
 
 static int avs_dai_fe_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)