Skip to content

Commit

Permalink
drm/amdgpu: fix hive reference leak when adding xgmi device
Browse files Browse the repository at this point in the history
Only amdgpu_get_xgmi_hive but no amdgpu_put_xgmi_hive
which will leak the hive reference.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
(cherry picked from commit 6fc25d0816322ea922535592a100ed8a503cdb8d)

Change-Id: I089bdc1d9dce00e8244ae4b4deb63dc0e3ec8893
  • Loading branch information
YiPeng Chai authored and Vignesh Chander committed Sep 7, 2022
1 parent c88f99b commit 9bb33db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2471,12 +2471,14 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
if (!hive->reset_domain ||
!amdgpu_reset_get_reset_domain(hive->reset_domain)) {
r = -ENOENT;
amdgpu_put_xgmi_hive(hive);
goto init_failed;
}

/* Drop the early temporary reset domain we created for device */
amdgpu_reset_put_reset_domain(adev->reset_domain);
adev->reset_domain = hive->reset_domain;
amdgpu_put_xgmi_hive(hive);
}
}

Expand Down

0 comments on commit 9bb33db

Please sign in to comment.