Skip to contentSkip to conversation

drm/amdgpu: fix double free err_addr pointer warnings

PATCH In review Bob Zhou 1 participant 1 message Apr 23, 2024

Subsystems (2)
lore
Share & tools
lore

Bob Zhou

author
#0 lore raw

PATCH 1/2 drm/amdgpu: fix double free err_addr pointer warnings

In amdgpu_umc_bad_page_polling_timeout, the amdgpu_umc_handle_bad_pages will be run many times so that double free err_addr in some special case. So set the err_addr to NULL to avoid the warnings.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +1 -0
index f486510fc94c..32e818d182fe 100644
@@ -170,6 +170,7 @@ static void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,
 	}
 
 	kfree(err_data->err_addr);
+	err_data->err_addr = NULL;
 
 	mutex_unlock(&con->page_retirement_lock);
 }
Signature · 1 line
2.34.1