[PATCH] amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create
Christian König
ckoenig.leichtzumerken at gmail.com
Wed Apr 21 10:28:55 UTC 2021
Am 21.04.21 um 11:16 schrieb Simon Ser:
> This error code-path is missing a drm_gem_object_put call. Other
> error code-paths are fine.
Good catch. For some extra points you could change the error handling
into using goto error instead of hand wiring it.
Either way patch is Reviewed-by: Christian König <christian.koenig at amd.com>
Thanks,
Christian.
>
> Signed-off-by: Simon Ser <contact at emersion.fr>
> Fixes: 1769152ac64b ("drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)")
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Harry Wentland <hwentlan at amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
> Cc: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 48cb33e5b382..1953223ecdba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -944,6 +944,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
> domains = amdgpu_display_supported_domains(drm_to_adev(dev), bo->flags);
> if (obj->import_attach && !(domains & AMDGPU_GEM_DOMAIN_GTT)) {
> drm_dbg_kms(dev, "Cannot create framebuffer from imported dma_buf\n");
> + drm_gem_object_put(obj);
> return ERR_PTR(-EINVAL);
> }
>
More information about the amd-gfx
mailing list