diff options
author | Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> | 2012-12-06 15:05:02 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-12-08 03:31:03 -0500 |
commit | 7d9c199a55200c9b9fcad08e150470d02fb385be (patch) | |
tree | a2268970fef6ab55b973e4a008a4bb9c1b5ae520 /drivers/infiniband | |
parent | 7bfcfa51c35cdd2d37e0d70fc11790642dd11fb3 (diff) |
RDMA/nes: Fix for crash when registering zero length MR for CQ
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index c47ec2599bc9..07e4fbad987a 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -2561,6 +2561,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, | |||
2561 | return ibmr; | 2561 | return ibmr; |
2562 | case IWNES_MEMREG_TYPE_QP: | 2562 | case IWNES_MEMREG_TYPE_QP: |
2563 | case IWNES_MEMREG_TYPE_CQ: | 2563 | case IWNES_MEMREG_TYPE_CQ: |
2564 | if (!region->length) { | ||
2565 | nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n"); | ||
2566 | ib_umem_release(region); | ||
2567 | return ERR_PTR(-EINVAL); | ||
2568 | } | ||
2564 | nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL); | 2569 | nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL); |
2565 | if (!nespbl) { | 2570 | if (!nespbl) { |
2566 | nes_debug(NES_DBG_MR, "Unable to allocate PBL\n"); | 2571 | nes_debug(NES_DBG_MR, "Unable to allocate PBL\n"); |