Unverified Commit a9a69c3b authored by Chenyuan Yang's avatar Chenyuan Yang Committed by Mark Brown
Browse files

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: default avatarChenyuan Yang <chenyuan0y@gmail.com>
Link: https://patch.msgid.link/20250406210854.149316-1-chenyuan0y@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e6c46184
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -544,7 +544,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
	if (!card->dai_link)
		return -ENOMEM;

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