Skip to content

Commit bed3af4

Browse files
Su HuiJoel Fernandes
authored andcommitted
rcuscale: using kcalloc() to relpace kmalloc()
It's safer to using kcalloc() because it can prevent overflow problem. Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Su Hui <[email protected]> Signed-off-by: Joel Fernandes <[email protected]>
1 parent 79ea7f4 commit bed3af4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/rcuscale.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ kfree_scale_thread(void *arg)
762762
}
763763

764764
for (i = 0; i < kfree_alloc_num; i++) {
765-
alloc_ptr = kmalloc(kfree_mult * sizeof(struct kfree_obj), GFP_KERNEL);
765+
alloc_ptr = kcalloc(kfree_mult, sizeof(struct kfree_obj), GFP_KERNEL);
766766
if (!alloc_ptr)
767767
return -ENOMEM;
768768

0 commit comments

Comments
 (0)