]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: reset psp->cmd to NULL after releasing the buffer
authorJiang Liu <gerry@linux.alibaba.com>
Fri, 7 Feb 2025 06:28:49 +0000 (14:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:13:26 +0000 (11:13 +0200)
[ Upstream commit e92f3f94cad24154fd3baae30c6dfb918492278d ]

Reset psp->cmd to NULL after releasing the buffer in function psp_sw_fini().

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index e5fc80ed06eaea285481eff414c31fa6b38f2893..665cc277cdc056676efc696a3ba3cf29df91995b 100644 (file)
@@ -533,7 +533,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);
 
@@ -543,8 +542,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);