[Linaro-mm-sig] [PATCH 3/4] dma-buf: Return error instead of using a goto statement when possible
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Jan 26 11:27:24 UTC 2012
Remove an error label in dma_buf_attach() that just returns an error
code.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
drivers/base/dma-buf.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 198edd8..97450a5 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);
--
1.7.3.4
More information about the Linaro-mm-sig
mailing list