Skip to content

Commit

Permalink
drm/gma500: Add the missed drm_gem_object_put() in psb_user_framebuff…
Browse files Browse the repository at this point in the history
…er_create()

[ Upstream commit cd8f318 ]

psb_user_framebuffer_create() misses to call drm_gem_object_put() in an
error path. Add the missed function call to fix it.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210629115956.15160-1-jingxiangfeng@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
hiss2018 authored and gregkh committed Jul 20, 2021
1 parent e43aa62 commit 4a54caa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/gma500/framebuffer.c
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 4a54caa

Please sign in to comment.