From 4aa7c77c382c25b8ed6a279f9f59e7c5ddb9cfb4 Mon Sep 17 00:00:00 2001 From: Shaoen-Lin Date: Mon, 1 Jun 2026 18:12:23 +0800 Subject: [PATCH] Fix vcam_device type in memset The vcam_devices array stores struct vcam_device pointers. Its allocation uses the same element type, but the memset size uses the pluralized struct vcam_devices tag. Use the actual element type to keep the allocation and initialization consistent. This does not change the cleared size because both expressions are pointer types. Signed-off-by: Shaoen-Lin --- control.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/control.c b/control.c index 5d3ba3d..a4b3441 100644 --- a/control.c +++ b/control.c @@ -217,8 +217,7 @@ static struct control_device *alloc_control_device(void) sizeof(struct vcam_device *) * devices_max, GFP_KERNEL); if (!(res->vcam_devices)) goto vcam_alloc_failure; - memset(res->vcam_devices, 0x00, - sizeof(struct vcam_devices *) * devices_max); + memset(res->vcam_devices, 0x00, sizeof(struct vcam_device *) * devices_max); res->vcam_device_count = 0; return res;