From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3000075AbdDZNHJ (ORCPT ); Wed, 26 Apr 2017 09:07:09 -0400 Received: from mout.web.de ([212.227.17.11]:62580 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034001AbdDZNG7 (ORCPT ); Wed, 26 Apr 2017 09:06:59 -0400 Subject: [PATCH 2/3] ASoC: simple-card: Use devm_kcalloc() in asoc_simple_card_probe() From: SF Markus Elfring To: alsa-devel@alsa-project.org, Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , Mark Brown , Nikita Yushchenko , Takashi Iwai Cc: LKML , kernel-janitors@vger.kernel.org References: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> Message-ID: Date: Wed, 26 Apr 2017 15:05:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:44nNkNezB0xz0n4COUC3oaUVC0RoZYfwUC25E80VKHiEIA4D2Fs UzYDE3eUVtNNK0KIJXYFF2jfvGEgFtdes3x5IW7ScjZ338eV1D+SYEjbf0XX4vS6fmn8gfu XOhDI96pJlEgB+r1cGjjwUVLHlsDf7GSpor3o3DYcNCl+MOXegcKariD0nrZhX12rd7QdVy XoHuWevSBBjDljBemVekg== X-UI-Out-Filterresults: notjunk:1;V01:K0:S1WwJXrucnw=:8xEUqhk5e4YfvbZAhegsDL RXA1EO/PwwOKsC65Bs1O2HqqcgxIXUNfCv1VoY+NPYWfSO+giO5KzeeqqSB7sLJbRC6b24eNx L/Iis14UH/GY27P+1cfPoYYz4v1SU/aa/a9rNua2quF5NkmPGF/fM3C9io5ULtenDoipkQnLR ebV4x/burIB7rhILUtV0mzae4Kxf5gfmfyNzzl1QyC6SfJXgrluWus13hsDUtD04NcL9V5cSX DTSjUIBrcszegUpJ909mHvJiMqpAmirYWkZy8OWAx7nd3n2pgM1aWKBblSaypspAc9f3al14d psEMONrOmtLurQyBWQVlzKeP/ZFxPoHyYD+kojQ6VKrlfoMgAtPvNvBYNvDYYRRUGo/mufuTm OMSSZ4QfE6woKFLcek9g6RGt2MtEGJLGkPrKdd8nKVJEYtHkk14H6TXiksM4baM/mT3BULRI9 y2aFWMrLFOHVIns996ldZMSpw1XLHfICFICmx3UGz/ZdrkA94z+oygZsG4o5PjonTUMREhNcP bSU+wJ1OaG8J2C7BJqgxL6hBeGwGtYHvboQjOadQZwpSS2SjEPy0aKEsjSmmYc3b0m6aPCIHh 7vKXHOkLnoL09rJGdn3SoPaHT9/hIQ8a5xmau4TMPqt38N2RH9hgjsMMiyIkm8bdhlpOW915S ukMEJmo8W2Qrphz7AvsrTAPGRKHIic9jNBWiY6sbhMgAb9IqXirC/Htpqsm2vRv7W+0V9D2Ky DahDC2vnzxzP9+hJH9+pykh150cti3IPOIrha0GhYM4BL5z5GRoykKq8nxiysxit0FjSVps8A pyg1FUe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 26 Apr 2017 14:32:12 +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 --- sound/soc/generic/simple-card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index b59d51374b89..55586326fde8 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -437,8 +437,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Wed, 26 Apr 2017 13:05:58 +0000 Subject: [PATCH 2/3] ASoC: simple-card: Use devm_kcalloc() in asoc_simple_card_probe() Message-Id: List-Id: References: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> In-Reply-To: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: alsa-devel@alsa-project.org, Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , Mark Brown , Nikita Yushchenko , Takashi Iwai Cc: kernel-janitors@vger.kernel.org, LKML From: Markus Elfring Date: Wed, 26 Apr 2017 14:32:12 +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 --- sound/soc/generic/simple-card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index b59d51374b89..55586326fde8 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -437,8 +437,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: [PATCH 2/3] ASoC: simple-card: Use devm_kcalloc() in asoc_simple_card_probe() Date: Wed, 26 Apr 2017 15:05:58 +0200 Message-ID: References: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> 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.11]) by alsa0.perex.cz (Postfix) with ESMTP id 3B6D4266FEC for ; Wed, 26 Apr 2017 15:06:09 +0200 (CEST) In-Reply-To: <8b5e37d1-17c5-4551-801f-ca7939d5efd7@users.sourceforge.net> 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, Jaroslav Kysela , Kuninori Morimoto , Liam Girdwood , Mark Brown , Nikita Yushchenko , Takashi Iwai Cc: kernel-janitors@vger.kernel.org, LKML List-Id: alsa-devel@alsa-project.org From: Markus Elfring Date: Wed, 26 Apr 2017 14:32:12 +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 --- sound/soc/generic/simple-card.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index b59d51374b89..55586326fde8 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -437,8 +437,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - 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