Skip to contentSkip to conversation

drm/panthor: validate group queue count

PATCH Applied Chia-I Wu 2 participants 2 messages Sep 3, 2025 – Sep 4, 2025

Subsystems (3)
lore
Share & tools
lore

Chia-I Wu

author
#0 lore raw

PATCH v2 1/1 drm/panthor: validate group queue count

A panthor group can have at most MAX_CS_PER_CSG panthor queues.

Fixes 4bdca11507928 ("drm/panthor: Add the driver frontend block")

---
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(-)
drivers/gpu/drm/panthor/panthor_drv.c +1 -1
index 9256806eb6623..4c202fc5ce050 100644
@@ -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);
Signature · 1 line
2.51.0.338.gd7d06c2dae-goog
maintainer Applied
#1 lore raw
Quoted 6 lines · Chia-I Wu

A panthor group can have at most MAX_CS_PER_CSG panthor queues.

Fixes 4bdca11507928 ("drm/panthor: Add the driver frontend block")

Pushed to drm-misc-fixes.

Thanks,
Steve

Quoted 22 lines

---
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(-)
drivers/gpu/drm/panthor/panthor_drv.c +1 -1
index 9256806eb6623..4c202fc5ce050 100644
@@ -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);