Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Bard Liao and committed by
Mark Brown
3c6f06a2 b0f6f4ac

+2 -1
+2 -1
sound/soc/sof/intel/hda.c
··· 1412 1412 link_mask |= BIT(peripherals->array[i]->bus->link_id); 1413 1413 1414 1414 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); 1416 1417 if (!links) 1417 1418 return NULL; 1418 1419