summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-08-04 11:32:45 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-08-04 11:32:45 +0000
commitb971f142de28c9c0551ab3bea1b575d1705498e4 (patch)
tree0517badc6e00d586b562f302fe0576fbf29f12e0
parent8010195fcffc1f167b74879e3a7c2ea6c034d86f (diff)
drm/amdgpu: Fix resource leak on probe error path
From Jiri Kosina fc2756cce06f9833ebabd309b5b5080ed5c56897 in linux 5.10.y/5.10.56 d47255d3f87338164762ac56df1f28d751e27246 in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
index 22b2ba03c94..b4c87152c9a 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
@@ -3380,13 +3380,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");
- goto failed_unmap;
+ return r;
}
/* early init functions */
r = amdgpu_device_ip_early_init(adev);
if (r)
- goto failed_unmap;
+ return r;
/* doorbell bar mapping and doorbell index init*/
amdgpu_device_doorbell_init(adev);
@@ -3619,12 +3619,6 @@ failed:
if (boco)
vga_switcheroo_fini_domain_pm_ops(adev->dev);
-failed_unmap:
-#ifdef __linux__
- iounmap(adev->rmmio);
- adev->rmmio = NULL;
-#endif
-
return r;
}