diff options
author | Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> | 2012-12-06 20:05:02 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 08:43:55 -0800 |
commit | 84181e48b7fd15d47ca85b711ee363da5e1fe108 (patch) | |
tree | fbe9423541dd619354ecbb06acac8c9dcd317566 | |
parent | f03ef102300ce1ac5744f2cee8e48825d6350222 (diff) | |
download | kernel_samsung_aries-84181e48b7fd15d47ca85b711ee363da5e1fe108.zip kernel_samsung_aries-84181e48b7fd15d47ca85b711ee363da5e1fe108.tar.gz kernel_samsung_aries-84181e48b7fd15d47ca85b711ee363da5e1fe108.tar.bz2 |
RDMA/nes: Fix for crash when registering zero length MR for CQ
commit 7d9c199a55200c9b9fcad08e150470d02fb385be upstream.
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 95ca93c..6da5224 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -2568,6 +2568,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"); |