Skip to content

Commit 8449d15

Browse files
Christoph Hellwigtorvalds
authored andcommitted
amdgpu: a NULL ->mm does not mean a thread is a kthread
Use the proper API instead. Fixes: 70539bd ("drm/amd: Update MEC HQD loading code for KFD") Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Jens Axboe <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Cc: Al Viro <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Jason Wang <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent b5265c8 commit 8449d15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *s
196196
pagefault_disable(); \
197197
if ((mmptr) == current->mm) { \
198198
valid = !get_user((dst), (wptr)); \
199-
} else if (current->mm == NULL) { \
199+
} else if (current->flags & PF_KTHREAD) { \
200200
kthread_use_mm(mmptr); \
201201
valid = !get_user((dst), (wptr)); \
202202
kthread_unuse_mm(mmptr); \

0 commit comments

Comments
 (0)