Skip to content

Commit

Permalink
drm: omapdrm: gem: Simplify error handling when creating GEM object
Browse files Browse the repository at this point in the history
The goto error statement end up just returning NULL without performing
any cleanup, replace it with a direct return.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Laurent Pinchart authored and Tomi Valkeinen committed Dec 31, 2015
1 parent 08b710f commit 92b4b44
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/omapdrm/omap_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,15 +1352,15 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
{
struct omap_drm_private *priv = dev->dev_private;
struct omap_gem_object *omap_obj;
struct drm_gem_object *obj = NULL;
struct drm_gem_object *obj;
struct address_space *mapping;
size_t size;
int ret;

if (flags & OMAP_BO_TILED) {
if (!priv->usergart) {
dev_err(dev->dev, "Tiled buffers require DMM\n");
goto fail;
return NULL;
}

/* tiled buffers are always shmem paged backed.. when they are
Expand Down Expand Up @@ -1431,9 +1431,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
return obj;

fail:
if (obj)
omap_gem_free_object(obj);

omap_gem_free_object(obj);
return NULL;
}

Expand Down

0 comments on commit 92b4b44

Please sign in to comment.