drm/scheduler: trivial error handling fix

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>
This commit is contained in:
Christian König 2018-08-14 09:41:12 +02:00 committed by Alex Deucher
parent ff30e9e850
commit 8acc725457
1 changed files with 3 additions and 0 deletions

View File

@ -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;