drm/amdgpu: unmap register bar on device init failure
Subsystems (2)
PATCH 1/1 drm/amdgpu: unmap register bar on device init failure
We never unmapped the regiser BAR on failure.
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -2
@@ -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);
@@ -3421,6 +3421,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; }
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Andrey Grodzovsky <[email protected]>
Andrey
Quoted 30 lines · Alex Deucher
We never unmapped the regiser BAR on failure.
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2
-2@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_init(struct amdgpu_device *adev, · line 3430
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4
-0@@ -3421,6 +3421,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; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx