From: Laurent Pinchart Date: Thu, 26 Jan 2012 11:27:24 +0000 (+0100) Subject: dma-buf: Return error instead of using a goto statement when possible X-Git-Tag: next-20120402~3^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=615103add715717a1cc17e237d64dec38e622610;p=karo-tx-linux.git 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 Reviewed-by: Daniel Vetter Signed-off-by: Sumit Semwal --- 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);