<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Bob Zhou <bob.zhou@amd.com><br>
<b>Sent:</b> Tuesday, April 23, 2024 1:32 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Cc:</b> Zhou, Bob <Bob.Zhou@amd.com><br>
<b>Subject:</b> [PATCH 1/2] drm/amdgpu: fix double free err_addr pointer warnings</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">In amdgpu_umc_bad_page_polling_timeout, the amdgpu_umc_handle_bad_pages<br>
will be run many times so that double free err_addr in some special case.<br>
So set the err_addr to NULL to avoid the warnings.<br>
<br>
Signed-off-by: Bob Zhou <bob.zhou@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c<br>
index f486510fc94c..32e818d182fe 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c<br>
@@ -170,6 +170,7 @@ static void amdgpu_umc_handle_bad_pages(struct amdgpu_device *adev,<br>
}<br>
<br>
kfree(err_data->err_addr);<br>
+ err_data->err_addr = NULL;<br>
<br>
mutex_unlock(&con->page_retirement_lock);<br>
}<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>