Re: [PATCH v2] drm/panthor: validate group queue count

From: Steven Price
Date: Thu Sep 04 2025 - 11:19:07 EST


On 03/09/2025 20:21, Chia-I Wu wrote:
> A panthor group can have at most MAX_CS_PER_CSG panthor queues.
>
> Fixes: 4bdca11507928 ("drm/panthor: Add the driver frontend block")
> Signed-off-by: Chia-I Wu <olvaffe@xxxxxxxxx>
> Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> # v1
> Reviewed-by: Steven Price <steven.price@xxxxxxx>

Pushed to drm-misc-fixes.

Thanks,
Steve

>
> ---
> v2:
> - move validation up to panthor_ioctl_group_create
> - add Fixes tag
> ---
> drivers/gpu/drm/panthor/panthor_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 9256806eb6623..4c202fc5ce050 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -1094,7 +1094,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);