Skip to content

Commit 4de7860

Browse files
committed
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: 5226d19 ("ASoC: SOF: Intel: use sof_sdw as default SDW machine driver") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent fcbe9f1 commit 4de7860

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sound/soc/sof/intel/hda.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,8 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
14121412
link_mask |= BIT(peripherals->array[i]->bus->link_id);
14131413

14141414
link_num = hweight32(link_mask);
1415-
links = devm_kcalloc(sdev->dev, link_num, sizeof(*links), GFP_KERNEL);
1415+
/* An empty adr_link is needed to terminate the adr_link loop */
1416+
links = devm_kcalloc(sdev->dev, link_num + 1, sizeof(*links), GFP_KERNEL);
14161417
if (!links)
14171418
return NULL;
14181419

0 commit comments

Comments
 (0)