We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2aa7e0 commit 44a10b4Copy full SHA for 44a10b4
sound/soc/intel/boards/sof_sdw.c
@@ -1995,8 +1995,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
1995
return ret;
1996
}
1997
1998
- /* One per DAI link, worst case is a DAI link for every endpoint */
1999
- sof_dais = kcalloc(num_ends, sizeof(*sof_dais), GFP_KERNEL);
+ /*
+ * One per DAI link, worst case is a DAI link for every endpoint, also
2000
+ * add one additional to act as a terminator such that code can iterate
2001
+ * until it hits an uninitialised DAI.
2002
+ */
2003
+ sof_dais = kcalloc(num_ends + 1, sizeof(*sof_dais), GFP_KERNEL);
2004
if (!sof_dais)
2005
return -ENOMEM;
2006
0 commit comments