Commit b5110eaf authored by Gongwei Li's avatar Gongwei Li Committed by Wei Liu
Browse files

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: default avatarGongwei Li <ligongwei@kylinos.cn>
Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
parent c720e6a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ static int util_probe(struct hv_device *dev,
		(struct hv_util_service *)dev_id->driver_data;
	int ret;

	srv->recv_buffer = kmalloc(HV_HYP_PAGE_SIZE * 4, GFP_KERNEL);
	srv->recv_buffer = kmalloc_array(4, HV_HYP_PAGE_SIZE, GFP_KERNEL);
	if (!srv->recv_buffer)
		return -ENOMEM;
	srv->channel = dev->channel;