gpu: host1x: syncpt: Use kcalloc() instead of kzalloc()
authorThierry Reding <treding@nvidia.com>
Thu, 23 Jun 2016 09:24:59 +0000 (11:24 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 23 Jun 2016 09:59:28 +0000 (11:59 +0200)
Use kcalloc() to allocate arrays rather than passing the product of the
size per element by the number of elements to kzalloc().

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/syncpt.c

index 3e91193..d70aad5 100644 (file)
@@ -343,12 +343,12 @@ int host1x_syncpt_init(struct host1x *host)
        struct host1x_syncpt *syncpt;
        unsigned int i;
 
-       syncpt = devm_kzalloc(host->dev, sizeof(*syncpt) * host->info->nb_pts,
+       syncpt = devm_kcalloc(host->dev, host->info->nb_pts, sizeof(*syncpt),
                              GFP_KERNEL);
        if (!syncpt)
                return -ENOMEM;
 
-       bases = devm_kzalloc(host->dev, sizeof(*bases) * host->info->nb_bases,
+       bases = devm_kcalloc(host->dev, host->info->nb_bases, sizeof(*bases),
                             GFP_KERNEL);
        if (!bases)
                return -ENOMEM;