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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
Signed-off-by: Jarod Wilson <jarod@xxxxxxxxxx>
---
 src/perftest_communication.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 		}
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux