drm/amdgpu: fix scheduler thread creation error checking

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
This commit is contained in:
Christian König 2015-08-20 16:59:38 +02:00 committed by Alex Deucher
parent aef4852eed
commit f495659821
1 changed files with 6 additions and 7 deletions

View File

@ -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);
return sched;
}
DRM_ERROR("Failed to create scheduler for id %d.\n", ring); DRM_ERROR("Failed to create scheduler for id %d.\n", ring);
kfree(sched); kfree(sched);
return NULL; return NULL;
}
return sched;
} }
/** /**