From: Matthew Brost Date: Thu, 30 May 2024 20:33:41 +0000 (-0700) Subject: drm/xe: Fix NULL ptr dereference in devcoredump X-Git-Tag: v6.11-rc1~141^2~26^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2bf9e95989c0163650dbeaede658d0fcf929063;p=thirdparty%2Fkernel%2Flinux.git 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 Cc: José Roberto de Souza Cc: stable@vger.kernel.org Signed-off-by: Matthew Brost Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20240530203341.1795181-1-matthew.brost@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c index 1973bfaece40d..d7f2d19a77c10 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;