Skip to content
Snippets Groups Projects
Commit a9fbc3b7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Sumit Semwal
Browse files

dma-buf: Return error instead of using a goto statement when possible


Remove an error label in dma_buf_attach() that just returns an error
code.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
parent d1aa06a1
No related branches found
No related tags found
No related merge requests found
......@@ -190,7 +190,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
if (attach == NULL)
goto err_alloc;
return ERR_PTR(-ENOMEM);
mutex_lock(&dmabuf->lock);
......@@ -206,8 +206,6 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
mutex_unlock(&dmabuf->lock);
return attach;
err_alloc:
return ERR_PTR(-ENOMEM);
err_attach:
kfree(attach);
mutex_unlock(&dmabuf->lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment