Am 2020-04-01 um 8:12 a.m. schrieb Jack Zhang:
> Originally, it kfrees the wrong pointer for mem_obj.
> It would cause memory leak under stress test.
>
> Signed-off-by: Jack Zhang <jack.zha...@amd.com>

Reviewed-by: Felix Kuehling <felix.kuehl...@amd.com>

Thanks for catching this. Did you actually run into this code path? In
that case we may also need to increase the GTT memory reserved for this
suballocator.

Thanks,
  Felix

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c 
> b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index 7866cd06..0491ab2 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -1134,9 +1134,9 @@ int kfd_gtt_sa_allocate(struct kfd_dev *kfd, unsigned 
> int size,
>       return 0;
>  
>  kfd_gtt_no_free_chunk:
> -     pr_debug("Allocation failed with mem_obj = %p\n", mem_obj);
> +     pr_debug("Allocation failed with mem_obj = %p\n", *mem_obj);
>       mutex_unlock(&kfd->gtt_sa_lock);
> -     kfree(mem_obj);
> +     kfree(*mem_obj);
>       return -ENOMEM;
>  }
>  
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to