mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
IB/umem: fix reference count leak in ib_umem_odp_get()
Add missing mmput() on error path to avoid ref-count leak. This problem is introduced by79bb5b7ee1
("RDMA/umem: Fix missing mmap_sem in get umem ODP call") and resolved byf27a0d50a4
("RDMA/umem: Use umem->owning_mm inside ODP"). So, it's only needed in stable-4.14 and stable-4.19. Fixes:79bb5b7ee1
("RDMA/umem: Fix missing mmap_sem in get umem ODP call") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2631d1bd96
commit
2c12c0ac37
1 changed files with 2 additions and 1 deletions
|
@ -306,7 +306,8 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem,
|
|||
vma = find_vma(mm, ib_umem_start(umem));
|
||||
if (!vma || !is_vm_hugetlb_page(vma)) {
|
||||
up_read(&mm->mmap_sem);
|
||||
return -EINVAL;
|
||||
ret_val = -EINVAL;
|
||||
goto out_mm;
|
||||
}
|
||||
h = hstate_vma(vma);
|
||||
umem->page_shift = huge_page_shift(h);
|
||||
|
|
Loading…
Reference in a new issue