mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
drm/amdgpu: unmap register bar on device init failure
We never unmapped the regiser BAR on failure. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
b6c91dadaf
commit
4192f7b576
1 changed files with 6 additions and 2 deletions
|
@ -3209,13 +3209,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
|
||||||
r = amdgpu_device_get_job_timeout_settings(adev);
|
r = amdgpu_device_get_job_timeout_settings(adev);
|
||||||
if (r) {
|
if (r) {
|
||||||
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
|
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
|
||||||
return r;
|
goto failed_unmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* early init functions */
|
/* early init functions */
|
||||||
r = amdgpu_device_ip_early_init(adev);
|
r = amdgpu_device_ip_early_init(adev);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
goto failed_unmap;
|
||||||
|
|
||||||
/* doorbell bar mapping and doorbell index init*/
|
/* doorbell bar mapping and doorbell index init*/
|
||||||
amdgpu_device_doorbell_init(adev);
|
amdgpu_device_doorbell_init(adev);
|
||||||
|
@ -3419,6 +3419,10 @@ failed:
|
||||||
if (boco)
|
if (boco)
|
||||||
vga_switcheroo_fini_domain_pm_ops(adev->dev);
|
vga_switcheroo_fini_domain_pm_ops(adev->dev);
|
||||||
|
|
||||||
|
failed_unmap:
|
||||||
|
iounmap(adev->rmmio);
|
||||||
|
adev->rmmio = NULL;
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue