Skip to content

Commit

Permalink
drm/scheduler: trivial error handling fix
Browse files Browse the repository at this point in the history
Return -ENOMEM when allocating the rq_list fails.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Aug 27, 2018
1 parent ff30e9e commit 8acc725
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/scheduler/gpu_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
entity->num_rq_list = num_rq_list;
entity->rq_list = kcalloc(num_rq_list, sizeof(struct drm_sched_rq *),
GFP_KERNEL);
if (!entity->rq_list)
return -ENOMEM;

for (i = 0; i < num_rq_list; ++i)
entity->rq_list[i] = rq_list[i];
entity->last_scheduled = NULL;
Expand Down

0 comments on commit 8acc725

Please sign in to comment.