free ras_if if ras is not supported
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
if (r)
goto late_fini;
- }
+ } else
+ kfree(adev->gfx.ras_if);
return 0;
late_fini:
r = amdgpu_irq_get(adev, &adev->gmc.ecc_irq, 0);
if (r)
goto umc_late_fini;
- }
+ } else
+ kfree(adev->gmc.umc_ras_if);
if (adev->mmhub_funcs && adev->mmhub_funcs->ras_late_init) {
r = adev->mmhub_funcs->ras_late_init(adev);
mmhub_ih_info.head = mmhub_fs_info.head = *adev->gmc.mmhub_ras_if;
r = amdgpu_ras_late_init(adev, adev->gmc.mmhub_ras_if,
&mmhub_fs_info, &mmhub_ih_info);
- if (r)
+ if (r || !amdgpu_ras_is_supported(adev, adev->gmc.mmhub_ras_if->block))
kfree(adev->gmc.mmhub_ras_if);
return r;
}
if (r)
goto late_fini;
}
- }
+ } else
+ kfree(adev->sdma.ras_if);
return 0;
late_fini: