From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: [PATCH] ASoC: hdmi-codec: Use devm_kcalloc() in hdmi_codec_probe() Date: Wed, 26 Apr 2017 12:48:06 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mout.web.de (mout.web.de [212.227.17.12]) by alsa0.perex.cz (Postfix) with ESMTP id 29D022670B0 for ; Wed, 26 Apr 2017 12:48:57 +0200 (CEST) Content-Language: en-GB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org, Arnaud Pouliquen , Jaroslav Kysela , Jon Medhurst , Jyri Sarha , Kuninori Morimoto , Liam Girdwood , Mark Brown , Philipp Zabel , Takashi Iwai , Vincent Abriou Cc: kernel-janitors@vger.kernel.org, LKML List-Id: alsa-devel@alsa-project.org From: Markus Elfring Date: Wed, 26 Apr 2017 12:26:06 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- sound/soc/codecs/hdmi-codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 8c5ae1fc23a9..99933488fa03 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -825,8 +825,7 @@ static int hdmi_codec_probe(struct platform_device *pdev) hcp->hcd = *hcd; mutex_init(&hcp->current_stream_lock); - - hcp->daidrv = devm_kzalloc(dev, dai_count * sizeof(*hcp->daidrv), + hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv), GFP_KERNEL); if (!hcp->daidrv) return -ENOMEM; -- 2.12.2