drm/amdgpu: fix double free err_addr pointer warnings
authorBob Zhou <bob.zhou@amd.com>
Tue, 23 Apr 2024 05:32:39 +0000 (13:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 26 Apr 2024 21:22:43 +0000 (17:22 -0400)
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.

Signed-off-by: Bob Zhou <bob.zhou@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c

index 8ebbca9e2e227834d8fc77d2b059b47eac4b7dfc..540e0f066b26f1a7916dcac648f592ef162a4b92 100644 (file)
@@ -179,6 +179,7 @@ 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);
 }