mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
mshv: use kmalloc_array in mshv_root_scheduler_init
Replace kmalloc() with kmalloc_array() to prevent potential overflow, as recommended in Documentation/process/deprecated.rst. No functional change. Signed-off-by: Can Peng <pengcan@kylinos.cn> Signed-off-by: Wei Liu <wei.liu@kernel.org>
This commit is contained in:
parent
840b740a35
commit
c53763aa2b
|
|
@ -2241,7 +2241,7 @@ static int mshv_root_scheduler_init(unsigned int cpu)
|
|||
outputarg = (void **)this_cpu_ptr(root_scheduler_output);
|
||||
|
||||
/* Allocate two consecutive pages. One for input, one for output. */
|
||||
p = kmalloc(2 * HV_HYP_PAGE_SIZE, GFP_KERNEL);
|
||||
p = kmalloc_array(2, HV_HYP_PAGE_SIZE, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user