Skip to content

Commit

Permalink
RDMA/nes: Fix for crash when registering zero length MR for CQ
Browse files Browse the repository at this point in the history
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Tatyana Nikolova authored and Roland Dreier committed Dec 8, 2012
1 parent 7bfcfa5 commit 7d9c199
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/hw/nes/nes_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
return ibmr;
case IWNES_MEMREG_TYPE_QP:
case IWNES_MEMREG_TYPE_CQ:
if (!region->length) {
nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n");
ib_umem_release(region);
return ERR_PTR(-EINVAL);
}
nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
if (!nespbl) {
nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");
Expand Down

0 comments on commit 7d9c199

Please sign in to comment.