Patchwork [3.5.y.z,extended,stable] Patch "RDMA/nes: Fix for crash when registering zero length MR for" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Jan. 14, 2013, 8:57 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/211916/
State New
Headers show


Herton Ronaldo Krzesinski - Jan. 14, 2013, 8:57 p.m.
This is a note to let you know that I have just added a patch titled

    RDMA/nes: Fix for crash when registering zero length MR for

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 89f0bdbc2d0fa3c96183555bb520205987ad9aac Mon Sep 17 00:00:00 2001
From: Tatyana Nikolova <>
Date: Thu, 6 Dec 2012 20:05:02 +0000
Subject: [PATCH] RDMA/nes: Fix for crash when registering zero length MR for

commit 7d9c199a55200c9b9fcad08e150470d02fb385be upstream.

Signed-off-by: Tatyana Nikolova <>
Signed-off-by: Roland Dreier <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 drivers/infiniband/hw/nes/nes_verbs.c |    5 +++++
 1 file changed, 5 insertions(+)



diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 2359568..da84ea3 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,
 			return ibmr;
+			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");