Commit b88f005e authored by Thierry Reding's avatar Thierry Reding

drm/tegra: fb: Properly release GEM objects on failure

When fbdev initialization fails, make sure to unreference the GEM
objects properly. Note that we can't do this in the general error
unwinding path because ownership of the GEM object references is
transferred to the framebuffer upon creation.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 9aaa0ceb
...@@ -227,7 +227,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, ...@@ -227,7 +227,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
info = framebuffer_alloc(0, drm->dev); info = framebuffer_alloc(0, drm->dev);
if (!info) { if (!info) {
dev_err(drm->dev, "failed to allocate framebuffer info\n"); dev_err(drm->dev, "failed to allocate framebuffer info\n");
tegra_bo_free_object(&bo->gem); drm_gem_object_unreference_unlocked(&bo->gem);
return -ENOMEM; return -ENOMEM;
} }
...@@ -235,6 +235,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, ...@@ -235,6 +235,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper,
if (IS_ERR(fbdev->fb)) { if (IS_ERR(fbdev->fb)) {
dev_err(drm->dev, "failed to allocate DRM framebuffer\n"); dev_err(drm->dev, "failed to allocate DRM framebuffer\n");
err = PTR_ERR(fbdev->fb); err = PTR_ERR(fbdev->fb);
drm_gem_object_unreference_unlocked(&bo->gem);
goto release; goto release;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment