mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
gpu: host1x: syncpt: Use kcalloc() instead of kzalloc()
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>
This commit is contained in:
parent
ebb2475c47
commit
b47a049196
@ -343,12 +343,12 @@ int host1x_syncpt_init(struct host1x *host)
|
|||||||
struct host1x_syncpt *syncpt;
|
struct host1x_syncpt *syncpt;
|
||||||
unsigned int i;
|
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);
|
GFP_KERNEL);
|
||||||
if (!syncpt)
|
if (!syncpt)
|
||||||
return -ENOMEM;
|
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);
|
GFP_KERNEL);
|
||||||
if (!bases)
|
if (!bases)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user