Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d9c199a authored by Tatyana Nikolova's avatar Tatyana Nikolova Committed by Roland Dreier
Browse files

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

parent 7bfcfa51
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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");