diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2012-08-01 18:06:18 -0700 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2012-08-13 14:13:13 +0530 |
commit | 5a3dbf76a6fa3b563cfcdba95e0337a214d9caf4 (patch) | |
tree | e4b9d2f2ce477d272cdfcb6cbe4dd07b7dca0bd9 | |
parent | aacca4e746b2cb9d32baf2d7fd07eadc08148bd0 (diff) |
gpu: ion: Don't call ion_buffer_put on error path
If dma_buf_fd fails, the dma_buf needs to be cleaned up by
calling dma_buf_put. dma_buf_put will call ion_dma_buf_release
which in turn calls ion_buffer_put to clean up the buffer
reference. Calling ion_buffer_put after dma_buf_put drops the
reference count by one more which is incorrect. Fix this by
getting rid of the extra ion_buffer_put call.
Change-Id: Ieb3a7b781bf2dc299c45384dbf0a12d186adeb22
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
-rw-r--r-- | drivers/gpu/ion/ion.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 705681a7280f..9128aed18f32 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -953,10 +953,9 @@ int ion_share_dma_buf(struct ion_client *client, struct ion_handle *handle) return PTR_ERR(dmabuf); } fd = dma_buf_fd(dmabuf, O_CLOEXEC); - if (fd < 0) { + if (fd < 0) dma_buf_put(dmabuf); - ion_buffer_put(buffer); - } + return fd; } EXPORT_SYMBOL(ion_share_dma_buf); |