If gfx sysfs init fails, we may leak the ip dump
allocations.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index a1aaf49d3bf84..d62826a0932e0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -1596,12 +1596,12 @@ static int gfx_v12_0_sw_init(struct amdgpu_ip_block 
*ip_block)
        if (r)
                return r;
 
-       gfx_v12_0_alloc_ip_dump(adev);
-
        r = amdgpu_gfx_sysfs_init(adev);
        if (r)
                return r;
 
+       gfx_v12_0_alloc_ip_dump(adev);
+
        adev->gfx.me.use_mmio_for_reset = false;
        adev->gfx.mec.use_mmio_for_reset = true;
 
-- 
2.55.0

Reply via email to