Skip to content

Commit

Permalink
RDMA/nes: Add missing calls to ib_umem_release()
Browse files Browse the repository at this point in the history
Add calls to ib_umem_release(), as in the other error-handling code in
nes_reg_user_mr().

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Julia Lawall authored and Roland Dreier committed Oct 6, 2011
1 parent 976d167 commit e2e435f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/infiniband/hw/nes/nes_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2338,8 +2338,10 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,

skip_pages = ((u32)region->offset) >> 12;

if (ib_copy_from_udata(&req, udata, sizeof(req)))
if (ib_copy_from_udata(&req, udata, sizeof(req))) {
ib_umem_release(region);
return ERR_PTR(-EFAULT);
}
nes_debug(NES_DBG_MR, "Memory Registration type = %08X.\n", req.reg_type);

switch (req.reg_type) {
Expand Down Expand Up @@ -2631,6 +2633,7 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
return &nesmr->ibmr;
}

ib_umem_release(region);
return ERR_PTR(-ENOSYS);
}

Expand Down

0 comments on commit e2e435f

Please sign in to comment.