Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Drivers: hv: use kmalloc_array() instead of kmalloc()

Replace kmalloc() with kmalloc_array() to prevent potential
overflow, as recommended in Documentation/process/deprecated.rst.

Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Gongwei Li and committed by
Wei Liu
b5110eaf c720e6a8

+1 -1
+1 -1
drivers/hv/hv_util.c
··· 586 586 (struct hv_util_service *)dev_id->driver_data; 587 587 int ret; 588 588 589 - srv->recv_buffer = kmalloc(HV_HYP_PAGE_SIZE * 4, GFP_KERNEL); 589 + srv->recv_buffer = kmalloc_array(4, HV_HYP_PAGE_SIZE, GFP_KERNEL); 590 590 if (!srv->recv_buffer) 591 591 return -ENOMEM; 592 592 srv->channel = dev->channel;