]> git.baikalelectronics.ru Git - kernel.git/commit
mm: mmap: fix fput in error path v2
authorChristian König <christian.koenig@amd.com>
Fri, 9 Oct 2020 13:08:55 +0000 (15:08 +0200)
committerChristian König <christian.koenig@amd.com>
Thu, 5 Nov 2020 12:03:43 +0000 (13:03 +0100)
commita140c69d7d051c91ca2e82bdae392d1c45b67b20
tree4bd2c28e4a1de36378eb7a45be3e81b52318f043
parent1c8cce1af13972cc20ea5a13f7c7f0e8dadb908f
mm: mmap: fix fput in error path v2

Patch "00792c23a9e4 CHROMIUM: dma-buf: restore args..."
adds a workaround for a bug in mmap_region.

As the comment states ->mmap() callback can change
vma->vm_file and so we might call fput() on the wrong file.

Revert the workaround and proper fix this in mmap_region.

v2: drop the extra if in dma_buf_mmap as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/394772/
drivers/dma-buf/dma-buf.c
mm/mmap.c