Skip to content

Commit 4192f7b

Browse files
committed
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>
1 parent b6c91da commit 4192f7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,13 +3209,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
32093209
r = amdgpu_device_get_job_timeout_settings(adev);
32103210
if (r) {
32113211
dev_err(adev->dev, "invalid lockup_timeout parameter syntax\n");
3212-
return r;
3212+
goto failed_unmap;
32133213
}
32143214

32153215
/* early init functions */
32163216
r = amdgpu_device_ip_early_init(adev);
32173217
if (r)
3218-
return r;
3218+
goto failed_unmap;
32193219

32203220
/* doorbell bar mapping and doorbell index init*/
32213221
amdgpu_device_doorbell_init(adev);
@@ -3419,6 +3419,10 @@ int amdgpu_device_init(struct amdgpu_device *adev,
34193419
if (boco)
34203420
vga_switcheroo_fini_domain_pm_ops(adev->dev);
34213421

3422+
failed_unmap:
3423+
iounmap(adev->rmmio);
3424+
adev->rmmio = NULL;
3425+
34223426
return r;
34233427
}
34243428

0 commit comments

Comments
 (0)