Commit 8acc7254 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/scheduler: trivial error handling fix

Return -ENOMEM when allocating the rq_list fails.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ff30e9e8
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment