aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJing Xiangfeng <[email protected]>2021-06-29 19:59:56 +0800
committerPatrik Jakobsson <[email protected]>2021-07-09 21:32:04 +0200
commita84cb7a494316fbe718e0588e827725aa5572d73 (patch)
tree32770ed12faead894b004868074273f834258f7e
parent710fa9aa16321f2ffdd8383f6f780c9cc1e5a197 (diff)
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: Patrik Jakobsson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c7
1 files changed, 6 insertions, 1 deletions
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,