[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5ccce752-8b67-ca22-0883-3a3628458fb6@users.sourceforge.net>
Date: Wed, 26 Apr 2017 15:06:58 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: alsa-devel@...a-project.org, Jaroslav Kysela <perex@...ex.cz>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Nikita Yushchenko <nikita.yoush@...entembedded.com>,
Takashi Iwai <tiwai@...e.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] ASoC: simple-scu-card: Use devm_kcalloc() in
asoc_simple_card_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 26 Apr 2017 14:40:40 +0200
Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "devm_kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
sound/soc/generic/simple-scu-card.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index dcbcab230d1b..530a7aa387c5 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -270,9 +270,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
return -ENOMEM;
num = of_get_child_count(np);
-
- dai_props = devm_kzalloc(dev, sizeof(*dai_props) * num, GFP_KERNEL);
- dai_link = devm_kzalloc(dev, sizeof(*dai_link) * num, GFP_KERNEL);
+ dai_props = devm_kcalloc(dev, num, sizeof(*dai_props), GFP_KERNEL);
+ dai_link = devm_kcalloc(dev, num, sizeof(*dai_link), GFP_KERNEL);
if (!dai_props || !dai_link)
return -ENOMEM;
--
2.12.2
Powered by blists - more mailing lists