summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2026-04-24 13:50:31 +0300
committerMark Brown <broonie@kernel.org>2026-04-27 00:54:56 +0300
commit3c6f06a200796ae7b2b1065e8a6499b138e27a50 (patch)
treea10e663554d89b1712e48d4083813d2e9a41876d
parentb0f6f4ac7d5d04fe2adcdd63ed1cd1ad505b8958 (diff)
downloadlinux-3c6f06a200796ae7b2b1065e8a6499b138e27a50.tar.xz
ASoC: SOF: Intel: add an empty adr_link
An empty adr_link is expected to terminate the for (adr_link = mach_params->links; adr_link->num_adr; adr_link++) loop. Allocate link_num + 1 links to add an empty adr_link. Fixes: 5226d19d4cae5 ("ASoC: SOF: Intel: use sof_sdw as default SDW machine driver") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260424105031.114053-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sof/intel/hda.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index b3d61d973ce4..8662b422eb80 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1412,7 +1412,8 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
link_mask |= BIT(peripherals->array[i]->bus->link_id);
link_num = hweight32(link_mask);
- links = devm_kcalloc(sdev->dev, link_num, sizeof(*links), GFP_KERNEL);
+ /* An empty adr_link is needed to terminate the adr_link loop */
+ links = devm_kcalloc(sdev->dev, link_num + 1, sizeof(*links), GFP_KERNEL);
if (!links)
return NULL;