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.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
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;
 
-- 
2.56.0

Reply via email to