From: Dave Airlie Date: Tue, 3 Nov 2015 16:10:03 +0000 (-0500) Subject: drm/amd/scheduler: don't oops on failure to load X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=32544d021515f767e651648e5702472d48ab9436;p=openwrt%2Fstaging%2Fblogic.git drm/amd/scheduler: don't oops on failure to load In two places amdgpu tries to tear down something it hasn't initalised when failing. This is what happens when you enable experimental support on topaz which then fails in ring init. This patch allows it to fail cleanly. agd: Split out from from the original patch since the scheduler is a driver independent. Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Dave Airlie Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 8dd7316b1d4f..b3e84d0f4ace 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -468,5 +468,6 @@ int amd_sched_init(struct amd_gpu_scheduler *sched, */ void amd_sched_fini(struct amd_gpu_scheduler *sched) { - kthread_stop(sched->thread); + if (sched->thread) + kthread_stop(sched->thread); }