On 03/12/2026 14:01, Tvrtko Ursulin wrote:
Start checking drm_sched_entity_init() return value in preparation of
making that API a bit stricter.
No functional change intended as the failure path should never trigger in
this driver given drm_sched_init() happens before and it's failure is
always fatal.
Sashiko raised a good point, it can still fail on memory allocation
failures. Need to rewrite the commit message and add the below tags
Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Fixes: fd177135f0e6 ("drm/sched: Account entity GPU time")
Cc: <[email protected]> # v7.2+
Regards,
Tvrtko
---
Compile tested only.
---
drivers/gpu/drm/msm/msm_submitqueue.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c
b/drivers/gpu/drm/msm/msm_submitqueue.c
index 8d550d281704..16852cf0c081 100644
--- a/drivers/gpu/drm/msm/msm_submitqueue.c
+++ b/drivers/gpu/drm/msm/msm_submitqueue.c
@@ -227,8 +227,13 @@ int msm_submitqueue_create(struct drm_device *drm, struct
msm_context *ctx,
queue->entity = &queue->_vm_bind_entity[0];
- drm_sched_entity_init(queue->entity, DRM_SCHED_PRIORITY_KERNEL,
- &sched, 1, NULL);
+ ret = drm_sched_entity_init(queue->entity,
+ DRM_SCHED_PRIORITY_KERNEL,
+ &sched, 1, NULL);
+ if (ret) {
+ kfree(queue);
+ return ret;
+ }
} else {
queue->ring_nr = ring_nr;