Commit 92b4b445 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm: omapdrm: gem: Simplify error handling when creating GEM object

The goto error statement end up just returning NULL without performing
any cleanup, replace it with a direct return.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 08b710f8
...@@ -1352,7 +1352,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, ...@@ -1352,7 +1352,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
{ {
struct omap_drm_private *priv = dev->dev_private; struct omap_drm_private *priv = dev->dev_private;
struct omap_gem_object *omap_obj; struct omap_gem_object *omap_obj;
struct drm_gem_object *obj = NULL; struct drm_gem_object *obj;
struct address_space *mapping; struct address_space *mapping;
size_t size; size_t size;
int ret; int ret;
...@@ -1360,7 +1360,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, ...@@ -1360,7 +1360,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
if (flags & OMAP_BO_TILED) { if (flags & OMAP_BO_TILED) {
if (!priv->usergart) { if (!priv->usergart) {
dev_err(dev->dev, "Tiled buffers require DMM\n"); dev_err(dev->dev, "Tiled buffers require DMM\n");
goto fail; return NULL;
} }
/* tiled buffers are always shmem paged backed.. when they are /* tiled buffers are always shmem paged backed.. when they are
...@@ -1431,9 +1431,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, ...@@ -1431,9 +1431,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
return obj; return obj;
fail: fail:
if (obj)
omap_gem_free_object(obj); omap_gem_free_object(obj);
return NULL; return NULL;
} }
......
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