drm/amdgpu: Skip put_reset_domain if it doesn't exist

For xgmi sriov, the reset is handled by host driver and hive->reset_domain
is not initialized so need to check if it exists before doing a put.

Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com>
Reviewed-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Vignesh Chander 2022-09-28 14:59:45 -04:00 committed by Alex Deucher
parent e67135571e
commit f61a825aa8
1 changed files with 2 additions and 1 deletions

View File

@ -113,6 +113,7 @@ static inline bool amdgpu_reset_get_reset_domain(struct amdgpu_reset_domain *dom
static inline void amdgpu_reset_put_reset_domain(struct amdgpu_reset_domain *domain)
{
if (domain)
kref_put(&domain->refcount, amdgpu_reset_destroy_reset_domain);
}