From: jsg Date: Wed, 4 Aug 2021 11:32:44 +0000 (+0000) Subject: drm/amdgpu: Fix resource leak on probe error path X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=43dd1d0082dcea86c02beb07e717b95a13020012;p=openbsd 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 --- 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; }