RDMA/hns: Fix refcount leak in hns_roce_mmap
[ Upstream commitpull/1175/headcf6a05c849] rdma_user_mmap_entry_get_pgoff() takes the reference. Add missing rdma_user_mmap_entry_put() to release the reference. Fixes:0045e0d3f4("RDMA/hns: Support direct wqe of userspace") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by Haoyue Xu <xuhaoyue1@hisilicon.com> Link: https://lore.kernel.org/r/20221223072900.802728-1-linmq006@gmail.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
parent
59d54a6515
commit
fa87cf2e75
|
|
@ -443,14 +443,15 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
|
|||
prot = pgprot_device(vma->vm_page_prot);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = rdma_user_mmap_io(uctx, vma, pfn, rdma_entry->npages * PAGE_SIZE,
|
||||
prot, rdma_entry);
|
||||
|
||||
out:
|
||||
rdma_user_mmap_entry_put(rdma_entry);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue