summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
authorFelix Kuehling2017-10-28 01:35:19 +0200
committerOded Gabbay2017-10-28 01:35:19 +0200
commit9b56bb115460cee92a80bf85232b4b7da2f080e6 (patch)
treea2c2d9888ab7e38c5659af2e7e47798ac4c2af6b /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parentdrm/amdkfd: Add SDMA trap src id to the KFD isr wanted list (diff)
downloadkernel-qcow2-linux-9b56bb115460cee92a80bf85232b4b7da2f080e6.tar.gz
kernel-qcow2-linux-9b56bb115460cee92a80bf85232b4b7da2f080e6.tar.xz
kernel-qcow2-linux-9b56bb115460cee92a80bf85232b4b7da2f080e6.zip
drm/amdkfd: Don't dereference kfd_process.mm
The kfd_process doesn't own a reference to the mm_struct, so it can disappear without warning even while the kfd_process still exists. Therefore, avoid dereferencing the kfd_process.mm pointer and make it opaque. Use get_task_mm to get a temporary reference to the mm when it's needed. v2: removed unnecessary WARN_ON Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 7d86ec9790d3..1a483a7ecd4e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -494,7 +494,12 @@ struct kfd_process {
*/
struct hlist_node kfd_processes;
- struct mm_struct *mm;
+ /*
+ * Opaque pointer to mm_struct. We don't hold a reference to
+ * it so it should never be dereferenced from here. This is
+ * only used for looking up processes by their mm.
+ */
+ void *mm;
struct mutex mutex;