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

drm/amdgpu: fix scheduler thread creation error checking

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
parent aef4852e
...@@ -367,15 +367,14 @@ struct amd_gpu_scheduler *amd_sched_create(void *device, ...@@ -367,15 +367,14 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
init_waitqueue_head(&sched->wait_queue); init_waitqueue_head(&sched->wait_queue);
atomic_set(&sched->hw_rq_count, 0); atomic_set(&sched->hw_rq_count, 0);
/* Each scheduler will run on a seperate kernel thread */ /* Each scheduler will run on a seperate kernel thread */
sched->thread = kthread_create(amd_sched_main, sched, name); sched->thread = kthread_run(amd_sched_main, sched, name);
if (sched->thread) { if (IS_ERR(sched->thread)) {
wake_up_process(sched->thread); DRM_ERROR("Failed to create scheduler for id %d.\n", ring);
return sched; kfree(sched);
return NULL;
} }
DRM_ERROR("Failed to create scheduler for id %d.\n", ring); return sched;
kfree(sched);
return 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