Skip to content

Commit ec44c00

Browse files
jgunthorpegregkh
authored andcommitted
RDMA/ocrdma: Don't NULL deref uctx on errors in ocrdma_copy_pd_uresp()
commit 34fbf48 upstream. Sashiko points out that pd->uctx isn't initialized until late in the function so all these error flow references are NULL and will crash. Use the uctx that isn't NULL. Cc: stable@vger.kernel.org Fixes: fe2caef ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter") Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=4 Link: https://patch.msgid.link/r/9-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 6fd9314 commit ec44c00

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,9 @@ static int ocrdma_copy_pd_uresp(struct ocrdma_dev *dev, struct ocrdma_pd *pd,
620620

621621
ucopy_err:
622622
if (pd->dpp_enabled)
623-
ocrdma_del_mmap(pd->uctx, dpp_page_addr, PAGE_SIZE);
623+
ocrdma_del_mmap(uctx, dpp_page_addr, PAGE_SIZE);
624624
dpp_map_err:
625-
ocrdma_del_mmap(pd->uctx, db_page_addr, db_page_size);
625+
ocrdma_del_mmap(uctx, db_page_addr, db_page_size);
626626
return status;
627627
}
628628

0 commit comments

Comments
 (0)