diff options
author | Christian König <christian.koenig@amd.com> | 2018-08-14 09:41:12 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-27 18:10:42 +0200 |
commit | 8acc7254577a3007029b4f13c759bf07d6719075 (patch) | |
tree | 18ef71acc9ba39bbf98df965e644474866919043 /drivers/gpu/drm/scheduler | |
parent | drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create() (diff) | |
download | linux-8acc7254577a3007029b4f13c759bf07d6719075.tar.xz linux-8acc7254577a3007029b4f13c759bf07d6719075.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/scheduler')
-rw-r--r-- | drivers/gpu/drm/scheduler/gpu_scheduler.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index f566405f49e3..85c1f95752cc 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -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; |