From e16644b0e907ea8650ee474b4590c9832e769dba Mon Sep 17 00:00:00 2001 From: Dennis Potter Date: Sat, 7 Jul 2018 12:56:08 +0200 Subject: [PATCH] Added some error handling in IB memory type --- lib/memory/ib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/memory/ib.c b/lib/memory/ib.c index 6cf0dbc66..5943fd8e9 100644 --- a/lib/memory/ib.c +++ b/lib/memory/ib.c @@ -55,6 +55,9 @@ static struct memory_allocation * memory_ib_alloc(struct memory_type *m, size_t ma->parent = mi->parent->alloc(mi->parent, len + sizeof(struct ibv_mr *), alignment); ma->address = ma->parent->address; + if(!mi->pd) + error("Protection domain is not registered!"); + ma->ib.mr = ibv_reg_mr(mi->pd, ma->address, ma->length, IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE); if(!ma->ib.mr) { mi->parent->free(mi->parent, ma->parent);