drm/panthor: validate group queue count

[ Upstream commit a00f2015ac ]

A panthor group can have at most MAX_CS_PER_CSG panthor queues.

Fixes: 4bdca11507 ("drm/panthor: Add the driver frontend block")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> # v1
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250903192133.288477-1-olvaffe@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chia-I Wu
2025-09-03 12:21:33 -07:00
committed by Greg Kroah-Hartman
parent e7639cf1e6
commit a506ffe193

View File

@@ -1023,7 +1023,7 @@ static int panthor_ioctl_group_create(struct drm_device *ddev, void *data,
struct drm_panthor_queue_create *queue_args;
int ret;
if (!args->queues.count)
if (!args->queues.count || args->queues.count > MAX_CS_PER_CSG)
return -EINVAL;
ret = PANTHOR_UOBJ_GET_ARRAY(queue_args, &args->queues);