diff options
| author | Can Peng <pengcan@kylinos.cn> | 2026-05-20 15:16:32 +0800 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2026-05-27 15:26:23 -0700 |
| commit | c53763aa2b9c96fbabee68ebe1e13074cb09bfb2 (patch) | |
| tree | 826e851eb74c53fd40a44f514b2726684ae5b430 | |
| parent | 840b740a35bf969734e0f2e44c21289fdd03079e (diff) | |
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>
| -rw-r--r-- | drivers/hv/mshv_root_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c index bd1359eb58dd..146726cc4e9b 100644 --- a/drivers/hv/mshv_root_main.c +++ b/drivers/hv/mshv_root_main.c @@ -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; |
