aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Brost <[email protected]>2024-05-30 13:33:41 -0700
committerMatthew Brost <[email protected]>2024-05-31 10:31:09 -0700
commitf2bf9e95989c0163650dbeaede658d0fcf929063 (patch)
tree75cd068b96e23e97ff9ef31a81cccf35cd4cf319
parentc063cce7df3a765539e2a2d75ab943f334446cce (diff)
drm/xe: Fix NULL ptr dereference in devcoredump
Kernel VM do not have an Xe file. Include a check for Xe file in the VM before trying to get pid from VM's Xe file when taking a devcoredump. Fixes: b10d0c5e9df7 ("drm/xe: Add process name to devcoredump") Cc: Rodrigo Vivi <[email protected]> Cc: José Roberto de Souza <[email protected]> Cc: [email protected] Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/xe/xe_devcoredump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
index 1973bfaece40..d7f2d19a77c1 100644
--- a/drivers/gpu/drm/xe/xe_devcoredump.c
+++ b/drivers/gpu/drm/xe/xe_devcoredump.c
@@ -176,7 +176,7 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump,
ss->snapshot_time = ktime_get_real();
ss->boot_time = ktime_get_boottime();
- if (q->vm) {
+ if (q->vm && q->vm->xef) {
task = get_pid_task(q->vm->xef->drm->pid, PIDTYPE_PID);
if (task)
process_name = task->comm;