diff --git a/fabtests/prov/efa/src/efa_exhaust_mr_reg_common.c b/fabtests/prov/efa/src/efa_exhaust_mr_reg_common.c index 67565e66206..e8a680ea7a4 100644 --- a/fabtests/prov/efa/src/efa_exhaust_mr_reg_common.c +++ b/fabtests/prov/efa/src/efa_exhaust_mr_reg_common.c @@ -20,6 +20,10 @@ int ft_efa_open_ibv_device(struct ibv_context **ctx) { return 0; } +int ft_efa_close_ibv_device(struct ibv_context *ctx) { + return ibv_close_device(ctx); +} + int ft_efa_get_max_mr(struct ibv_context *ctx) { int ret; struct ibv_device_attr dev_attr = {0}; diff --git a/fabtests/prov/efa/src/efa_exhaust_mr_reg_rdm_pingpong.c b/fabtests/prov/efa/src/efa_exhaust_mr_reg_rdm_pingpong.c index 6c1092c3f60..fe49df3b36e 100644 --- a/fabtests/prov/efa/src/efa_exhaust_mr_reg_rdm_pingpong.c +++ b/fabtests/prov/efa/src/efa_exhaust_mr_reg_rdm_pingpong.c @@ -40,7 +40,7 @@ int main(int argc, char **argv) size_t registered; void **buffers = NULL; struct ibv_mr **mr_reg_vec = NULL; - struct ibv_context *ibv_ctx; + struct ibv_context *ibv_ctx = NULL; struct ibv_pd *pd; opts = INIT_OPTS; @@ -135,6 +135,7 @@ int main(int argc, char **argv) if (err) FT_PRINTERR("ibv mr dereg", -err); ft_efa_destroy_ibv_pd(pd); + ft_efa_close_ibv_device(ibv_ctx); } free(buffers);