During exporting dma_buf, it can fail after dma_buf is exported. In this case, exported dma_buf should be release with putting. Also dma_buf_fd can be failed to get fd, but failure cases are not handled.
Error handling routine is not quite clean, so I send this patch set as RFC.
Seung-Woo Kim (1): drm/prime: reorder drm_prime_add_buf_handle and remove prototype
YoungJun Cho (2): drm/prime: fix to put an exported dma_buf for adding handle failure drm/prime: add return check for dma_buf_fd
drivers/gpu/drm/drm_prime.c | 79 +++++++++++++++++++++++++++--------------- 1 files changed, 51 insertions(+), 28 deletions(-)