Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit aa665c3

Browse files
Ma Jungregkh
authored andcommitted
Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"
commit 03c6284 upstream. This patch causes the following iounmap erorr and calltrace iounmap: bad address 00000000d0b3631f The original patch was unjustified because amdgpu_device_fini_sw() will always cleanup the rmmio mapping. This reverts commit eb4f139. Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Suggested-by: Christian König <christian.koenig@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dd0ad48 commit aa665c3

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4025,10 +4025,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
40254025
* early on during init and before calling to RREG32.
40264026
*/
40274027
adev->reset_domain = amdgpu_reset_create_reset_domain(SINGLE_DEVICE, "amdgpu-reset-dev");
4028-
if (!adev->reset_domain) {
4029-
r = -ENOMEM;
4030-
goto unmap_memory;
4031-
}
4028+
if (!adev->reset_domain)
4029+
return -ENOMEM;
40324030

40334031
/* detect hw virtualization here */
40344032
amdgpu_detect_virtualization(adev);
@@ -4038,20 +4036,20 @@ int amdgpu_device_init(struct amdgpu_device *adev,
40384036
r = amdgpu_device_get_job_timeout_settings(adev);
40394037
if (r) {
40404038
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
4041-
goto unmap_memory;
4039+
return r;
40424040
}
40434041

40444042
/* early init functions */
40454043
r = amdgpu_device_ip_early_init(adev);
40464044
if (r)
4047-
goto unmap_memory;
4045+
return r;
40484046

40494047
amdgpu_device_set_mcbp(adev);
40504048

40514049
/* Get rid of things like offb */
40524050
r = drm_aperture_remove_conflicting_pci_framebuffers(adev->pdev, &amdgpu_kms_driver);
40534051
if (r)
4054-
goto unmap_memory;
4052+
return r;
40554053

40564054
/* Enable TMZ based on IP_VERSION */
40574055
amdgpu_gmc_tmz_set(adev);
@@ -4061,7 +4059,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
40614059
if (adev->gmc.xgmi.supported) {
40624060
r = adev->gfxhub.funcs->get_xgmi_info(adev);
40634061
if (r)
4064-
goto unmap_memory;
4062+
return r;
40654063
}
40664064

40674065
/* enable PCIE atomic ops */
@@ -4330,8 +4328,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
43304328
failed:
43314329
amdgpu_vf_error_trans_all(adev);
43324330

4333-
unmap_memory:
4334-
iounmap(adev->rmmio);
43354331
return r;
43364332
}
43374333

0 commit comments

Comments
 (0)