Message ID | 20250104061519.2540178-1-kalesh-anakkur.purayil@broadcom.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [for-rc] RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error | expand |
On Sat, 04 Jan 2025 11:45:19 +0530, Kalesh AP wrote: > In the error handling path of bnxt_re_mmap(), driver should invoke > rdma_user_mmap_entry_put() to free the reference of mmap entry in case > the error happens after rdma_user_mmap_entry_get was called. > > Applied, thanks! [1/1] RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error https://git.kernel.org/rdma/rdma/c/c84f0f4f49d816 Best regards,
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index e3d26bd6de05..1ff2e176b036 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -4467,9 +4467,10 @@ int bnxt_re_mmap(struct ib_ucontext *ib_uctx, struct vm_area_struct *vma) case BNXT_RE_MMAP_TOGGLE_PAGE: /* Driver doesn't expect write access for user space */ if (vma->vm_flags & VM_WRITE) - return -EFAULT; - ret = vm_insert_page(vma, vma->vm_start, - virt_to_page((void *)bnxt_entry->mem_offset)); + ret = -EFAULT; + else + ret = vm_insert_page(vma, vma->vm_start, + virt_to_page((void *)bnxt_entry->mem_offset)); break; default: ret = -EINVAL;