diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/thread.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/thread.c b/drivers/gpu/nvgpu/common/linux/thread.c index fe3906eb..92c556f2 100644 --- a/drivers/gpu/nvgpu/common/linux/thread.c +++ b/drivers/gpu/nvgpu/common/linux/thread.c | |||
@@ -46,8 +46,10 @@ int nvgpu_thread_create(struct nvgpu_thread *thread, | |||
46 | 46 | ||
47 | void nvgpu_thread_stop(struct nvgpu_thread *thread) | 47 | void nvgpu_thread_stop(struct nvgpu_thread *thread) |
48 | { | 48 | { |
49 | kthread_stop(thread->task); | 49 | if (thread->task) { |
50 | thread->task = NULL; | 50 | kthread_stop(thread->task); |
51 | thread->task = NULL; | ||
52 | } | ||
51 | }; | 53 | }; |
52 | 54 | ||
53 | bool nvgpu_thread_should_stop(struct nvgpu_thread *thread) | 55 | bool nvgpu_thread_should_stop(struct nvgpu_thread *thread) |