]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/amdgpu: fix scheduler thread creation error checking
authorChristian König <christian.koenig@amd.com>
Thu, 20 Aug 2015 14:59:38 +0000 (16:59 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Aug 2015 14:43:46 +0000 (10:43 -0400)
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c

index 0133697c127eb773d8c9ccbfb086390bfba59191..435d70499d3e9764e88ff4a15d92bf18fe00ed96 100644 (file)
@@ -367,15 +367,14 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
        init_waitqueue_head(&sched->wait_queue);
        atomic_set(&sched->hw_rq_count, 0);
        /* Each scheduler will run on a seperate kernel thread */
-       sched->thread = kthread_create(amd_sched_main, sched, name);
-       if (sched->thread) {
-               wake_up_process(sched->thread);
-               return sched;
+       sched->thread = kthread_run(amd_sched_main, sched, name);
+       if (IS_ERR(sched->thread)) {
+               DRM_ERROR("Failed to create scheduler for id %d.\n", ring);
+               kfree(sched);
+               return NULL;
        }
 
-       DRM_ERROR("Failed to create scheduler for id %d.\n", ring);
-       kfree(sched);
-       return NULL;
+       return sched;
 }
 
 /**