drm/amdgpu: Fix the null pointer dereference to ras_manager
authorjsg <jsg@openbsd.org>
Thu, 15 Aug 2024 02:58:13 +0000 (02:58 +0000)
committerjsg <jsg@openbsd.org>
Thu, 15 Aug 2024 02:58:13 +0000 (02:58 +0000)
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

index 36af1f4..2909991 100644 (file)
@@ -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;