[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMeQTsbgrTa09t+qBHzoSRmK=WU5K0uTuQ8xRN7zd6XRMYMQsw@mail.gmail.com>
Date: Fri, 9 Jul 2021 21:35:51 +0200
From: Patrik Jakobsson <patrik.r.jakobsson@...il.com>
To: Jing Xiangfeng <jingxiangfeng@...wei.com>
Cc: David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/gma500: Add the missed drm_gem_object_put() in psb_user_framebuffer_create()
On Tue, Jun 29, 2021 at 1:52 PM Jing Xiangfeng <jingxiangfeng@...wei.com> wrote:
>
> psb_user_framebuffer_create() misses to call drm_gem_object_put() in an
> error path. Add the missed function call to fix it.
>
Sorry for the delay, I'm currently on vacation.
Looks good. Thanks for the patch.
Applied to drm-misc-next
-Patrik
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>
> ---
> drivers/gpu/drm/gma500/framebuffer.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
> index ebe9dccf2d83..0b8648396fb2 100644
> --- a/drivers/gpu/drm/gma500/framebuffer.c
> +++ b/drivers/gpu/drm/gma500/framebuffer.c
> @@ -352,6 +352,7 @@ static struct drm_framebuffer *psb_user_framebuffer_create
> const struct drm_mode_fb_cmd2 *cmd)
> {
> struct drm_gem_object *obj;
> + struct drm_framebuffer *fb;
>
> /*
> * Find the GEM object and thus the gtt range object that is
> @@ -362,7 +363,11 @@ static struct drm_framebuffer *psb_user_framebuffer_create
> return ERR_PTR(-ENOENT);
>
> /* Let the core code do all the work */
> - return psb_framebuffer_create(dev, cmd, obj);
> + fb = psb_framebuffer_create(dev, cmd, obj);
> + if (IS_ERR(fb))
> + drm_gem_object_put(obj);
> +
> + return fb;
> }
>
> static int psbfb_probe(struct drm_fb_helper *fb_helper,
> --
> 2.26.0.106.g9fadedd
>
Powered by blists - more mailing lists