]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SOF: ipc4-topology: fix alh_group_ida max value
authorBard Liao <yung-chuan.liao@linux.intel.com>
Mon, 22 Aug 2022 19:02:11 +0000 (21:02 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 23 Aug 2022 16:34:06 +0000 (17:34 +0100)
group_id is from 0 ~ ALH_MULTI_GTW_COUNT - 1, not 0 ~
ALH_MULTI_GTW_COUNT.

Fixes: a150345aa7584 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220822190211.170537-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c

index c6abfaf5d53268b63df6ca229e29dc7589b4079c..64929dc9af397e1119fa86577f61ca8b93cc9ff2 100644 (file)
@@ -1251,7 +1251,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
                        if (blob->alh_cfg.count > 1) {
                                int group_id;
 
-                               group_id = ida_alloc_max(&alh_group_ida, ALH_MULTI_GTW_COUNT,
+                               group_id = ida_alloc_max(&alh_group_ida, ALH_MULTI_GTW_COUNT - 1,
                                                         GFP_KERNEL);
 
                                if (group_id < 0)