drm/amdgpu: Skip put_reset_domain if it doesnt exist
Subsystems (2)
PATCH 1/1 drm/amdgpu: Skip put_reset_domain if it doesnt 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 <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +2 -1
@@ -113,7 +113,8 @@ static inline bool amdgpu_reset_get_reset_domain(struct amdgpu_reset_domain *domstatic 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,
Signature · 1 line
2.25.1
Looks OK to me.
Reviewed by : shaoyun.liu <[email protected]>
________________________________
From: Chander, Vignesh <[email protected]>
Sent: September 28, 2022 3:03 PM
To: [email protected] <[email protected]>
Cc: Liu, Shaoyun <[email protected]>; Chander, Vignesh <[email protected]>
Subject: [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt 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 <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +2 -1
@@ -113,7 +113,8 @@ static inline bool amdgpu_reset_get_reset_domain(struct amdgpu_reset_domain *domstatic 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,
--
2.25.1