aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-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,
190 190
191 attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL); 191 attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
192 if (attach == NULL) 192 if (attach == NULL)
193 goto err_alloc; 193 return ERR_PTR(-ENOMEM);
194 194
195 mutex_lock(&dmabuf->lock); 195 mutex_lock(&dmabuf->lock);
196 196
@@ -206,8 +206,6 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
206 mutex_unlock(&dmabuf->lock); 206 mutex_unlock(&dmabuf->lock);
207 return attach; 207 return attach;
208 208
209err_alloc:
210 return ERR_PTR(-ENOMEM);
211err_attach: 209err_attach:
212 kfree(attach); 210 kfree(attach);
213 mutex_unlock(&dmabuf->lock); 211 mutex_unlock(&dmabuf->lock);