Skip to contentSkip to conversation

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

PATCH New Tatyana Nikolova 1 participant 1 message Dec 6, 2012 InfiniBand

lore
Share & tools
lore
#0 lore raw

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

Fix for crash when registering zero length memory region for CQ

---
 drivers/infiniband/hw/nes/nes_verbs.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/infiniband/hw/nes/nes_verbs.c +5 -0
index c47ec25..07e4fba 100644
@@ -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");
Signature · 6 lines
1.7.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html