diff options
author | 2025-04-22 09:51:45 +0800 | |
---|---|---|
committer | 2025-05-16 09:00:54 -0400 | |
commit | bed3af437f38f9a7a8b8a7de153a421f023c6e0b (patch) | |
tree | 22c9c4401afc3c5bd37c1b4b2d4adc171d854d83 | |
parent | doc/RCU/listRCU: refine example code for eliminating stale data (diff) | |
download | wireguard-linux-bed3af437f38f9a7a8b8a7de153a421f023c6e0b.tar.xz wireguard-linux-bed3af437f38f9a7a8b8a7de153a421f023c6e0b.zip |
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; |