From: Jiang Liu Date: Fri, 7 Feb 2025 06:28:49 +0000 (+0800) Subject: drm/amdgpu: reset psp->cmd to NULL after releasing the buffer X-Git-Tag: v6.15-rc1~120^2~17^2~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e92f3f94cad24154fd3baae30c6dfb918492278d;p=thirdparty%2Fkernel%2Flinux.git drm/amdgpu: reset psp->cmd to NULL after releasing the buffer Reset psp->cmd to NULL after releasing the buffer in function psp_sw_fini(). Reviewed-by: Lijo Lazar Signed-off-by: Jiang Liu Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index c609c96a999d5..48b55dae62412 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -541,7 +541,6 @@ static int psp_sw_fini(struct amdgpu_ip_block *ip_block) { struct amdgpu_device *adev = ip_block->adev; struct psp_context *psp = &adev->psp; - struct psp_gfx_cmd_resp *cmd = psp->cmd; psp_memory_training_fini(psp); @@ -551,8 +550,8 @@ static int psp_sw_fini(struct amdgpu_ip_block *ip_block) amdgpu_ucode_release(&psp->cap_fw); amdgpu_ucode_release(&psp->toc_fw); - kfree(cmd); - cmd = NULL; + kfree(psp->cmd); + psp->cmd = NULL; psp_free_shared_bufs(psp);