From: Vignesh Chander Date: Wed, 28 Sep 2022 18:59:45 +0000 (-0400) Subject: drm/amdgpu: Skip put_reset_domain if it doesn't exist X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f61a825aa86115dbdcaba25bba78e007b5e8e1b1;p=linux.git 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 Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h index dc43fcb93eac7..f5318fedf2f04 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h @@ -113,7 +113,8 @@ 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) { - kref_put(&domain->refcount, amdgpu_reset_destroy_reset_domain); + if (domain) + kref_put(&domain->refcount, amdgpu_reset_destroy_reset_domain); } static inline bool amdgpu_reset_domain_schedule(struct amdgpu_reset_domain *domain,