aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/dma-buf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 97450a52172..8afe2dd1791 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -192,10 +192,11 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
192 if (attach == NULL) 192 if (attach == NULL)
193 return ERR_PTR(-ENOMEM); 193 return ERR_PTR(-ENOMEM);
194 194
195 mutex_lock(&dmabuf->lock);
196
197 attach->dev = dev; 195 attach->dev = dev;
198 attach->dmabuf = dmabuf; 196 attach->dmabuf = dmabuf;
197
198 mutex_lock(&dmabuf->lock);
199
199 if (dmabuf->ops->attach) { 200 if (dmabuf->ops->attach) {
200 ret = dmabuf->ops->attach(dmabuf, dev, attach); 201 ret = dmabuf->ops->attach(dmabuf, dev, attach);
201 if (ret) 202 if (ret)