Skip to content

Commit a9a69c3

Browse files
WhiteFox-Projectbroonie
authored andcommitted
ASoC: imx-card: Adjust over allocation of memory in imx_card_parse_of()
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>
1 parent e6c4618 commit a9a69c3

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
@@ -544,7 +544,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
544544
if (!card->dai_link)
545545
return -ENOMEM;
546546

547-
data->link_data = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL);
547+
data->link_data = devm_kcalloc(dev, num_links, sizeof(*link_data), GFP_KERNEL);
548548
if (!data->link_data)
549549
return -ENOMEM;
550550

0 commit comments

Comments
 (0)