From aa9b4d72b8ea54c818b7a51be9f382b396be6f91 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 30 Nov 2023 02:32:22 +0000 Subject: [PATCH] drm/amdgpu: Fix potential null pointer derefernce From Stanley Yang 9b70fc7d70e8ef7c4a65034c9487f58609e708a1 in linux-6.1.y/6.1.64 80285ae1ec8717b597b20de38866c29d84d321a1 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c index 9573eb6b288..3aec9245de2 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c @@ -5466,7 +5466,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, * Flush RAM to disk so that after reboot * the user can read log and see why the system rebooted. */ - if (need_emergency_restart && amdgpu_ras_get_context(adev)->reboot) { + if (need_emergency_restart && amdgpu_ras_get_context(adev) && + amdgpu_ras_get_context(adev)->reboot) { DRM_WARN("Emergency reboot."); #ifdef notyet -- 2.20.1