[2/3] drm/amdgpu: fix missed asd bo free when hw_fini

Submitted by Huang, Ray on July 4, 2017, 6:10 a.m.

Details

Message ID 1499148650-22409-2-git-send-email-ray.huang@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Huang, Ray July 4, 2017, 6:10 a.m.
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 1469e6d..7b43c60 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -446,6 +446,11 @@  static int psp_hw_fini(void *handle)
 		amdgpu_bo_free_kernel(&psp->fence_buf_bo,
 				      &psp->fence_buf_mc_addr, &psp->fence_buf);
 
+	if (psp->asd_shared_bo)
+		amdgpu_bo_free_kernel(&psp->asd_shared_bo,
+				      &psp->asd_shared_mc_addr,
+				      &psp->asd_shared_buf);
+
 	kfree(psp->cmd);
 	psp->cmd = NULL;
 

Comments

Am 04.07.2017 um 08:10 schrieb Huang Rui:
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 1469e6d..7b43c60 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -446,6 +446,11 @@ static int psp_hw_fini(void *handle)
>   		amdgpu_bo_free_kernel(&psp->fence_buf_bo,
>   				      &psp->fence_buf_mc_addr, &psp->fence_buf);
>   
> +	if (psp->asd_shared_bo)
> +		amdgpu_bo_free_kernel(&psp->asd_shared_bo,
> +				      &psp->asd_shared_mc_addr,
> +				      &psp->asd_shared_buf);
> +

Good catch, but again please remove the "if".

With that fixed the patch is Reviewed-by: Christian K├Ânig 
<christian.koenig@amd.com>.

Regards,
Christian.

>   	kfree(psp->cmd);
>   	psp->cmd = NULL;
>