summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-01-26 12:27:24 +0100
committerSumit Semwal <sumit.semwal@ti.com>2012-03-19 15:42:15 +0530
commita9fbc3b73127efba9276e172daa8d122f0fac1a8 (patch)
tree09eb3b471a631217de8c533293571c2d7968981d
parentd1aa06a1eaf5f751c9913703031d611599d8d3d7 (diff)
downloadlinux-stable-a9fbc3b73127efba9276e172daa8d122f0fac1a8.tar.gz
linux-stable-a9fbc3b73127efba9276e172daa8d122f0fac1a8.tar.bz2
linux-stable-a9fbc3b73127efba9276e172daa8d122f0fac1a8.zip
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
-rw-r--r--drivers/base/dma-buf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 198edd8a9f0a..97450a52172c 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -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);