diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-12-14 22:39:41 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-12-31 11:25:46 +0200 |
commit | 92b4b44538a034495fc598f61cc95f4e647adbd1 (patch) | |
tree | efd2789c6fbd853c6258e4b545461172466ac10a /drivers/gpu/drm/omapdrm/omap_gem.c | |
parent | 08b710f85cb835114257fe60c9f0ca5610c8ac29 (diff) | |
download | lwn-92b4b44538a034495fc598f61cc95f4e647adbd1.tar.gz lwn-92b4b44538a034495fc598f61cc95f4e647adbd1.zip |
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_gem.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index c215feccf092..a589685ec63d 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -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_gem_object *omap_obj; - struct drm_gem_object *obj = NULL; + struct drm_gem_object *obj; struct address_space *mapping; size_t size; int ret; @@ -1360,7 +1360,7 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev, 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 @@ -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; } |