Fix error path of xe_exec_queue_create_ioctl()
Subsystems (3)
cover Fix error path of xe_exec_queue_create_ioctl()
Split to 2 patches due to different Fixes tag.
Shuicheng Lin (2):
drm/xe: Fix missing xe_hw_engine_group_del_exec_queue() in error path drm/xe: Fix exec queue unwind on hw engine group add failure
drivers/gpu/drm/xe/xe_exec_queue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
PATCH 1/2 drm/xe: Fix missing xe_hw_engine_group_del_exec_queue() in error path
When xa_alloc() fails after xe_hw_engine_group_add_exec_queue() has already succeeded, xe_hw_engine_group_del_exec_queue() is missed to undo the add.
Add xe_hw_engine_group_del_exec_queue() at the kill_exec_queue label to fix it.
--- drivers/gpu/drm/xe/xe_exec_queue.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/xe/xe_exec_queue.c +2 -0
@@ -1408,6 +1408,8 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,return 0 ; kill_exec_queue: +if (q->vm && q->hwe->hw_engine_group) +xe_hw_engine_group_del_exec_queue (q->hwe->hw_engine_group, q);xe_exec_queue_kill (q); delete_queue_group:if (xe_exec_queue_is_multi_queue_secondary (q))
Signature · 1 line
2.34.1
PATCH 2/2 drm/xe: Fix exec queue unwind on hw engine group add failure
In reply to Shuicheng LinWhen xe_hw_engine_group_add_exec_queue() fails in xe_exec_queue_create_ioctl(), to undo xe_exec_queue_group_add() and xe_vm_add_compute_exec_queue(), the code should unwind through kill_exec_queue rather than directly dropping the queue reference.
v2: correct the jump label. (Matt)
--- drivers/gpu/drm/xe/xe_exec_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_exec_queue.c +1 -1
@@ -1390,7 +1390,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,if (q->vm && q->hwe->hw_engine_group) { err =xe_hw_engine_group_add_exec_queue (q->hwe->hw_engine_group, q);if (err) - goto put_exec_queue; + goto kill_exec_queue; } }
Signature · 1 line
2.34.1