drm/amdgpu: check mmhub_funcs pointer before refering to it

mmhub callback functions are not initialized for all the ASICs

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>
This commit is contained in:
Hawking Zhang 2019-08-31 13:18:40 +08:00 committed by Alex Deucher
parent 17da41bf00
commit 4ce71be67b

View file

@ -799,7 +799,7 @@ static int gmc_v9_0_ecc_late_init(void *handle)
goto umc_late_fini;
}
if (adev->mmhub_funcs->ras_late_init) {
if (adev->mmhub_funcs && adev->mmhub_funcs->ras_late_init) {
r = adev->mmhub_funcs->ras_late_init(adev);
if (r)
return r;