From: Hariprasad S Date: Thu, 6 Nov 2014 09:12:56 +0000 (+0530) Subject: rping: Fixes race, where ibv context was getting freed before memory was deregistered X-Git-Tag: v1.0.20~9 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=5ae36aba6f9507324048d1d6d5536bed6f5fe92c;p=~shefty%2Flibrdmacm.git rping: Fixes race, where ibv context was getting freed before memory was deregistered While running rping as a client without server on the other end, rping_test_client fails and the ibv context was getting freed before memory was deregistered. This patch fixes it. Signed-off-by: Hariprasad Shenai Signed-off-by: Sean Hefty --- diff --git a/examples/rping.c b/examples/rping.c index 949cbe67..f0414dec 100644 --- a/examples/rping.c +++ b/examples/rping.c @@ -1055,18 +1055,19 @@ static int rping_run_client(struct rping_cb *cb) ret = rping_connect_client(cb); if (ret) { fprintf(stderr, "connect error %d\n", ret); - goto err2; + goto err3; } ret = rping_test_client(cb); if (ret) { fprintf(stderr, "rping client failed: %d\n", ret); - goto err3; + goto err4; } ret = 0; -err3: +err4: rdma_disconnect(cb->cm_id); +err3: pthread_join(cb->cqthread, NULL); err2: rping_free_buffers(cb);