diff options
-rw-r--r-- | drivers/staging/android/ion/ion.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b94d69feff46..b0b96ab31954 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1108,11 +1108,6 @@ struct dma_buf *ion_share_dma_buf(struct ion_client *client, bool valid_handle; DEFINE_DMA_BUF_EXPORT_INFO(exp_info); - exp_info.ops = &dma_buf_ops; - exp_info.size = buffer->size; - exp_info.flags = O_RDWR; - exp_info.priv = buffer; - mutex_lock(&client->lock); valid_handle = ion_handle_validate(client, handle); if (!valid_handle) { @@ -1124,6 +1119,11 @@ struct dma_buf *ion_share_dma_buf(struct ion_client *client, ion_buffer_get(buffer); mutex_unlock(&client->lock); + exp_info.ops = &dma_buf_ops; + exp_info.size = buffer->size; + exp_info.flags = O_RDWR; + exp_info.priv = buffer; + dmabuf = dma_buf_export(&exp_info); if (IS_ERR(dmabuf)) { ion_buffer_put(buffer); |