aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
diff options
context:
space:
mode:
authorLijo Lazar <[email protected]>2025-09-02 06:07:37 +0000
committerGreg Kroah-Hartman <[email protected]>2025-11-13 20:37:23 +0000
commitcfee28ef80e15c6768385dff28b037356a89b871 (patch)
treef66f19cf4ba9c5fdec4b78b89a1f06d1cf0b6970 /drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
parentdrm/amdgpu: validate userq buffer virtual address and size (diff)
downloadkernel-cfee28ef80e15c6768385dff28b037356a89b871.tar.gz
kernel-cfee28ef80e15c6768385dff28b037356a89b871.zip
drm/amdgpu: Release hive reference properly
[ Upstream commit c1456fadce0c99175f97e66c2b982dd051e01aa2 ] xgmi hive reference is taken on function entry, but not released correctly for all paths. Use __free() to release reference properly. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Ce Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
index bba0b26fee8f..5f36aff17e79 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h
@@ -126,4 +126,8 @@ uint32_t amdgpu_xgmi_get_max_bandwidth(struct amdgpu_device *adev);
void amgpu_xgmi_set_max_speed_width(struct amdgpu_device *adev,
uint16_t max_speed, uint8_t max_width);
+
+/* Cleanup macro for use with __free(xgmi_put_hive) */
+DEFINE_FREE(xgmi_put_hive, struct amdgpu_hive_info *, if (_T) amdgpu_put_xgmi_hive(_T))
+
#endif