On 5/14/2024 9:42 AM, Ma Jun wrote: > Check ras_manager before using it > > Signed-off-by: Ma Jun <Jun.Ma2@xxxxxxx> Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx> Thanks, Lijo > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > index 925ec65ac5ed..2bcf5c3b5d70 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > @@ -2172,12 +2172,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; >