diff mbox

[perftest,14/23] perftest_communication: fix ibv_create_ah failure check

Message ID 1471541538-20270-15-git-send-email-jarod@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jarod Wilson Aug. 18, 2016, 5:32 p.m. UTC
We've already dereferenced ctx->ah by assigning the return value of
ibv_create_ah to ctx->ah[0], so this check as-is will currently never
trip. I believe what was meant was to check for a failure of
ibv_create_ah, which returns 0 on success or the value of errno on
failure. Just check for non-zero ctx->ah[0] instead.

CC: Gil Rockah <gilr@mellanox.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
 src/perftest_communication.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/perftest_communication.c b/src/perftest_communication.c
index bec973a..d938e41 100755
--- a/src/perftest_communication.c
+++ b/src/perftest_communication.c
@@ -1007,7 +1007,7 @@  int rdma_client_connect(struct pingpong_context *ctx,struct perftest_parameters
 
 		ctx->ah[0] = ibv_create_ah(ctx->pd,&event->param.ud.ah_attr);
 
-		if (!ctx->ah) {
+		if (ctx->ah[0]) {
 			printf(" Unable to create address handler for UD QP\n");
 			return FAILURE;
 		}