Skip to content

Commit ecc36a8

Browse files
jgunthorpegregkh
authored andcommitted
RDMA/vmw_pvrdma: Fix double free on pvrdma_alloc_ucontext() error path
commit e38e869 upstream. Sashiko points out that pvrdma_uar_free() is already called within pvrdma_dealloc_ucontext(), so calling it before triggers a double free. Cc: stable@vger.kernel.org Fixes: 29c8d9e ("IB: Add vmw_pvrdma driver") Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=4 Link: https://patch.msgid.link/r/10-v1-41f3135e5565+9d2-rdma_ai_fixes1_jgg@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e3dc3a2 commit ecc36a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ int pvrdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
350350
uresp.qp_tab_size = vdev->dsr->caps.max_qp;
351351
ret = ib_copy_to_udata(udata, &uresp, sizeof(uresp));
352352
if (ret) {
353-
pvrdma_uar_free(vdev, &context->uar);
353+
/* pvrdma_dealloc_ucontext() also frees the UAR */
354354
pvrdma_dealloc_ucontext(&context->ibucontext);
355355
return -EFAULT;
356356
}

0 commit comments

Comments
 (0)