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_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -1
@@ -217,7 +217,8 @@ static void amdgpu_xgmi_hive_release(struct kobject *kobj)struct amdgpu_hive_info *hive =container_of ( kobj, struct amdgpu_hive_info, kobj); -amdgpu_reset_put_reset_domain (hive->reset_domain); +if (hive->reset_domain) +amdgpu_reset_put_reset_domain (hive->reset_domain); hive->reset_domain =NULL ;mutex_destroy (&hive->hive_lock);
Signature · 1 line
2.25.1
Christian König
maintainerAm 28.09.22 um 20:22 schrieb Vignesh Chander:
Quoted 2 lines
For xgmi sriov, the reset is handled by host driver and
hive->reset_domainis not initialized so need to check if it exists before doing a put.
Once more: General practice is to make the *_put_*() functions NULL tolerant.
So rather make this than this patch here.
Regards,
Christian.
Quoted 19 lines
Signed-off-by Vignesh Chander <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2
-1@@ -217,7 +217,8 @@ static void amdgpu_xgmi_hive_release(struct kobject *kobj)struct amdgpu_hive_info *hive =container_of ( kobj, struct amdgpu_hive_info, kobj); -amdgpu_reset_put_reset_domain (hive->reset_domain); +if (hive->reset_domain) +amdgpu_reset_put_reset_domain (hive->reset_domain); hive->reset_domain =NULL ;mutex_destroy (&hive->hive_lock);