From 8602cf8bff3de046a319b2e7feed6f8e80a7ae8c Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 15 Aug 2024 02:58:13 +0000 Subject: [PATCH] drm/amdgpu: Fix the null pointer dereference to ras_manager From Ma Jun b89616333979114bb0da5fa40fb6e4a2f5294ca2 in linux-6.6.y/6.6.46 4c11d30c95576937c6c35e6f29884761f2dddb43 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c index 36af1f4e451..2909991515f 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c @@ -1800,12 +1800,15 @@ static void amdgpu_ras_interrupt_process_handler(struct work_struct *work) int amdgpu_ras_interrupt_dispatch(struct amdgpu_device *adev, struct ras_dispatch_if *info) { - struct ras_manager *obj = amdgpu_ras_find_obj(adev, &info->head); - struct ras_ih_data *data = &obj->ih_data; + struct ras_manager *obj; + struct ras_ih_data *data; + obj = amdgpu_ras_find_obj(adev, &info->head); if (!obj) return -EINVAL; + data = &obj->ih_data; + if (data->inuse == 0) return 0; -- 2.20.1