AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Simon Ser <contact@emersion.fr>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Harry Wentland <hwentlan@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
	Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Subject: Re: [PATCH] amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create
Date: Wed, 21 Apr 2021 12:28:55 +0200	[thread overview]
Message-ID: <93008f80-edeb-de1c-35ca-15bbe872f8dc@gmail.com> (raw)
In-Reply-To: <20210421091635.77483-1-contact@emersion.fr>

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@amd.com>

Thanks,
Christian.

>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Fixes: 1769152ac64b ("drm/amdgpu: Fail fb creation from imported dma-bufs. (v2)")
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Harry Wentland <hwentlan@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Bas Nieuwenhuizen <bas@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);
>   	}
>   

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-04-21 10:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  9:16 [PATCH] amdgpu: fix GEM obj leak in amdgpu_display_user_framebuffer_create Simon Ser
2021-04-21 10:28 ` Christian König [this message]
2021-04-28 21:14   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93008f80-edeb-de1c-35ca-15bbe872f8dc@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bas@basnieuwenhuizen.nl \
    --cc=contact@emersion.fr \
    --cc=hwentlan@amd.com \
    --cc=nicholas.kazlauskas@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox