From 89ffa669b69c7e0007f4a5dc92e9abc8c71ec3c4 Mon Sep 17 00:00:00 2001 From: Ashutosh Jain Date: Fri, 13 Apr 2018 21:20:54 +0530 Subject: gpu: nvgpu: Fix map buffer overflow handling. Currently in case of overflow in buffer mapping the dma buf fd reference is not freed which causes the handle to remain allocated forever. Bug 200398767 Change-Id: Id3bf88636b927d75595f8a8b9f240b6717bf3b57 Signed-off-by: Ashutosh Jain Reviewed-on: https://git-master.nvidia.com/r/1694864 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Richard Zhao Reviewed-by: svc-mobile-coverity Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/vm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/common/linux/vm.c') diff --git a/drivers/gpu/nvgpu/common/linux/vm.c b/drivers/gpu/nvgpu/common/linux/vm.c index 52b2f30c..75572b93 100644 --- a/drivers/gpu/nvgpu/common/linux/vm.c +++ b/drivers/gpu/nvgpu/common/linux/vm.c @@ -285,6 +285,7 @@ int nvgpu_vm_map_buffer(struct vm_gk20a *vm, nvgpu_err(g, "buf size %llx < (offset(%llx) + map_size(%llx))\n", (u64)dmabuf->size, buffer_offset, mapping_size); + dma_buf_put(dmabuf); return -EINVAL; } -- cgit v1.2.2