Skip to content

Commit 3b860d6

Browse files
WhiteFox-Projectjfvogel
authored andcommitted
ASoC: imx-card: Adjust over allocation of memory in imx_card_parse_of()
[ Upstream commit a9a69c3 ] Incorrect types are used as sizeof() arguments in devm_kcalloc(). It should be sizeof(dai_link_data) for link_data instead of sizeof(snd_soc_dai_link). This is found by our static analysis tool. Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Link: https://patch.msgid.link/20250406210854.149316-1-chenyuan0y@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit b5aa85b9b0c4c7c6db39c31a56b01aaa331a5589) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent 2128b87 commit 3b860d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/fsl/imx-card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
516516
if (!card->dai_link)
517517
return -ENOMEM;
518518

519-
data->link_data = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL);
519+
data->link_data = devm_kcalloc(dev, num_links, sizeof(*link_data), GFP_KERNEL);
520520
if (!data->link_data)
521521
return -ENOMEM;
522522

0 commit comments

Comments
 (0)