Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
drm/amdgpu: unmap register bar on device init failure
Browse files Browse the repository at this point in the history
We never unmapped the regiser BAR on failure.

Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Andrey Grodzovsky <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
alexdeucher committed Sep 17, 2020
1 parent b6c91da commit 4192f7b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -3209,13 +3209,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
r = amdgpu_device_get_job_timeout_settings(adev);
if (r) {
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
return r;
goto failed_unmap;
}

/* early init functions */
r = amdgpu_device_ip_early_init(adev);
if (r)
return r;
goto failed_unmap;

/* doorbell bar mapping and doorbell index init*/
amdgpu_device_doorbell_init(adev);
Expand Down Expand Up @@ -3419,6 +3419,10 @@ int amdgpu_device_init(struct amdgpu_device *adev,
if (boco)
vga_switcheroo_fini_domain_pm_ops(adev->dev);

failed_unmap:
iounmap(adev->rmmio);
adev->rmmio = NULL;

return r;
}

Expand Down

0 comments on commit 4192f7b

Please sign in to comment.