[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250406210854.149316-1-chenyuan0y@gmail.com>
Date: Sun, 6 Apr 2025 16:08:54 -0500
From: Chenyuan Yang <chenyuan0y@...il.com>
To: shengjiu.wang@...il.com,
Xiubo.Lee@...il.com,
festevam@...il.com,
nicoleotsuka@...il.com,
lgirdwood@...il.com,
broonie@...nel.org,
perex@...ex.cz,
tiwai@...e.com,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de
Cc: linux-sound@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Chenyuan Yang <chenyuan0y@...il.com>
Subject: [PATCH] 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@...il.com>
---
sound/soc/fsl/imx-card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index 3686d468506b..45e000f61ecc 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -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;
--
2.34.1
Powered by blists - more mailing lists