diff options
author | Rolf Eike Beer <eb@emlix.com> | 2018-11-21 13:12:52 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-11-29 10:50:09 +0100 |
commit | bd49f2f34b4ef33210d8b511656fd9b6714b6c7f (patch) | |
tree | ec5f496ff68ec6c9cf9c6391c2dae7083951e1d9 | |
parent | 9be20e200ae372abf9fcce92b737bda94a79c56f (diff) |
gk20a: use kcalloc() to allocate arrays
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 4a06a94ed66f..b0eb2cc40cd7 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -1545,8 +1545,7 @@ static int gk20a_init_pmu_setup_sw(struct gk20a *g) /* TBD: sysmon subtask */ pmu->mutex_cnt = pwr_pmu_mutex__size_1_v(); - pmu->mutex = kzalloc(pmu->mutex_cnt * - sizeof(struct pmu_mutex), GFP_KERNEL); + pmu->mutex = kcalloc(pmu->mutex_cnt, sizeof(*pmu->mutex), GFP_KERNEL); if (!pmu->mutex) { err = -ENOMEM; goto err; @@ -1557,8 +1556,8 @@ static int gk20a_init_pmu_setup_sw(struct gk20a *g) pmu->mutex[i].index = i; } - pmu->seq = kzalloc(PMU_MAX_NUM_SEQUENCES * - sizeof(struct pmu_sequence), GFP_KERNEL); + pmu->seq = kcalloc(PMU_MAX_NUM_SEQUENCES, sizeof(*pmu->seq), + GFP_KERNEL); if (!pmu->seq) { err = -ENOMEM; goto err_free_mutex; |