]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Fix NULL ptr dereference in devcoredump
authorMatthew Brost <matthew.brost@intel.com>
Thu, 30 May 2024 20:33:41 +0000 (13:33 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Fri, 31 May 2024 17:31:09 +0000 (10:31 -0700)
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 <rodrigo.vivi@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240530203341.1795181-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_devcoredump.c

index 1973bfaece40db3d8a55391ad7ef02d76781b2c2..d7f2d19a77c10dc6dd9d2657a4e60e8fdcfdc3cc 100644 (file)
@@ -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;