Skip to content

Commit feb0f02

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 <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>
1 parent 3e4a253 commit feb0f02

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)