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>
 {
        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);
 
        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);