Skip to content

Commit d1505d8

Browse files
WhiteFox-ProjectSasha Levin
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 68988b4 commit d1505d8

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

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

0 commit comments

Comments
 (0)