提交 a8b48df5 编写于 作者: T Thierry Reding

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: NThierry Reding <treding@nvidia.com>
上级 c28d4a31
...@@ -166,23 +166,21 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, ...@@ -166,23 +166,21 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file,
unsigned int *handle) unsigned int *handle)
{ {
struct tegra_bo *bo; struct tegra_bo *bo;
int ret; int err;
bo = tegra_bo_create(drm, size, flags); bo = tegra_bo_create(drm, size, flags);
if (IS_ERR(bo)) if (IS_ERR(bo))
return bo; return bo;
ret = drm_gem_handle_create(file, &bo->gem, handle); err = drm_gem_handle_create(file, &bo->gem, handle);
if (ret) if (err) {
goto err; tegra_bo_free_object(&bo->gem);
return ERR_PTR(err);
}
drm_gem_object_unreference_unlocked(&bo->gem); drm_gem_object_unreference_unlocked(&bo->gem);
return bo; return bo;
err:
tegra_bo_free_object(&bo->gem);
return ERR_PTR(ret);
} }
static struct tegra_bo *tegra_bo_import(struct drm_device *drm, static struct tegra_bo *tegra_bo_import(struct drm_device *drm,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册