]> 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)
commit441fa03a45b96ae2a2f228978afef400e68e94f2
tree4bd2c28e4a1de36378eb7a45be3e81b52318f043
parent1706539c5c84045c1142586beb6bdb53a0e44f95
mm: mmap: fix fput in error path v2

Patch "908404a62459 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