aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/coresight/coresight-platform.c
diff options
context:
space:
mode:
authorXu Wang <vulab@iscas.ac.cn>2020-07-16 11:57:36 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-21 15:48:39 +0200
commit870fdd851ca50ffa552c41fd127afafceb303eca (patch)
tree20e30fdaabd107fdab2a3826281b4e8c0f551f1e /drivers/hwtracing/coresight/coresight-platform.c
parentdt-bindings: arm: coresight: Add optional property to replicators (diff)
downloadlinux-dev-870fdd851ca50ffa552c41fd127afafceb303eca.tar.xz
linux-dev-870fdd851ca50ffa552c41fd127afafceb303eca.zip
coresight: Use devm_kcalloc() in coresight_alloc_conns()
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". Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200716175746.3338735-8-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-platform.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-platform.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index e4912abda3aa..bfd44231d7ad 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -27,9 +27,8 @@ static int coresight_alloc_conns(struct device *dev,
struct coresight_platform_data *pdata)
{
if (pdata->nr_outport) {
- pdata->conns = devm_kzalloc(dev, pdata->nr_outport *
- sizeof(*pdata->conns),
- GFP_KERNEL);
+ pdata->conns = devm_kcalloc(dev, pdata->nr_outport,
+ sizeof(*pdata->conns), GFP_KERNEL);
if (!pdata->conns)
return -ENOMEM;
}