aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGongwei Li <ligongwei@kylinos.cn>2025-11-21 11:10:41 +0800
committerWei Liu <wei.liu@kernel.org>2025-12-05 23:16:49 +0000
commitb5110eaf67530091343b519d8abd0cddd14660f2 (patch)
treedc7f3df606ac2add642614078cc3f07562d6eac0
parentc720e6a873cc97bdfe8912986e26ceaeeaa6b240 (diff)
downloadtip-b5110eaf67530091343b519d8abd0cddd14660f2.tar.gz
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>
-rw-r--r--drivers/hv/hv_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 36ee89c0358bd0..7e9c8e169c66a6 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -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;