Skip to content

Commit cd8f318

Browse files
hiss2018danvet
authored andcommitted
drm/gma500: Add the missed drm_gem_object_put() in psb_user_framebuffer_create()
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 <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 82c850c commit cd8f318

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/gma500/framebuffer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ static struct drm_framebuffer *psb_user_framebuffer_create
352352
const struct drm_mode_fb_cmd2 *cmd)
353353
{
354354
struct drm_gem_object *obj;
355+
struct drm_framebuffer *fb;
355356

356357
/*
357358
* Find the GEM object and thus the gtt range object that is
@@ -362,7 +363,11 @@ static struct drm_framebuffer *psb_user_framebuffer_create
362363
return ERR_PTR(-ENOENT);
363364

364365
/* Let the core code do all the work */
365-
return psb_framebuffer_create(dev, cmd, obj);
366+
fb = psb_framebuffer_create(dev, cmd, obj);
367+
if (IS_ERR(fb))
368+
drm_gem_object_put(obj);
369+
370+
return fb;
366371
}
367372

368373
static int psbfb_probe(struct drm_fb_helper *fb_helper,

0 commit comments

Comments
 (0)