diff options
author | Thierry Reding <treding@nvidia.com> | 2014-10-16 14:22:50 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-11-13 16:14:47 +0100 |
commit | a8b48df5925fad5ba9ebc49c80ef60774cc97628 (patch) | |
tree | ff62a64df4acd43227abc0bdf31a4c0a519b4671 /drivers | |
parent | c28d4a317fef0401be180b34f48d193ff2a6787b (diff) | |
download | linux-a8b48df5925fad5ba9ebc49c80ef60774cc97628.tar.bz2 |
drm/tegra: gem: Cleanup tegra_bo_create_with_handle()
There is only a single location where the function needs to do cleanup.
Skip the error unwinding path and call the cleanup function directly
instead.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index d86ded791935..b1d778a7f3e7 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -166,23 +166,21 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, unsigned int *handle) { struct tegra_bo *bo; - int ret; + int err; bo = tegra_bo_create(drm, size, flags); if (IS_ERR(bo)) return bo; - ret = drm_gem_handle_create(file, &bo->gem, handle); - if (ret) - goto err; + err = drm_gem_handle_create(file, &bo->gem, handle); + if (err) { + tegra_bo_free_object(&bo->gem); + return ERR_PTR(err); + } drm_gem_object_unreference_unlocked(&bo->gem); return bo; - -err: - tegra_bo_free_object(&bo->gem); - return ERR_PTR(ret); } static struct tegra_bo *tegra_bo_import(struct drm_device *drm, |