diff options
| author | Su Hui <suhui@nfschina.com> | 2025-04-22 04:51:45 +0300 |
|---|---|---|
| committer | Joel Fernandes <joelagnelf@nvidia.com> | 2025-05-16 16:00:54 +0300 |
| commit | bed3af437f38f9a7a8b8a7de153a421f023c6e0b (patch) | |
| tree | 22c9c4401afc3c5bd37c1b4b2d4adc171d854d83 | |
| parent | 79ea7f43f8d5aeefc711d4ce322e0a7fbf41de14 (diff) | |
| download | linux-bed3af437f38f9a7a8b8a7de153a421f023c6e0b.tar.xz | |
rcuscale: using kcalloc() to relpace kmalloc()
It's safer to using kcalloc() because it can prevent overflow
problem.
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
| -rw-r--r-- | kernel/rcu/rcuscale.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 0f3059b1b80d..b521d0455992 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -762,7 +762,7 @@ kfree_scale_thread(void *arg) } for (i = 0; i < kfree_alloc_num; i++) { - alloc_ptr = kmalloc(kfree_mult * sizeof(struct kfree_obj), GFP_KERNEL); + alloc_ptr = kcalloc(kfree_mult, sizeof(struct kfree_obj), GFP_KERNEL); if (!alloc_ptr) return -ENOMEM; |
