Hello,

This fixes a bug in 3 tests where the result of ibv_open_device is not checked. 
 I added a couple missing endlines too.

Frank.
diff --git a/COPYING b/COPYING
diff --git a/Makefile b/Makefile
diff --git a/README b/README
diff --git a/clock_test.c b/clock_test.c
diff --git a/get_clock.c b/get_clock.c
diff --git a/get_clock.h b/get_clock.h
diff --git a/multicast_resources.c b/multicast_resources.c
diff --git a/multicast_resources.h b/multicast_resources.h
diff --git a/perftest.spec b/perftest.spec
diff --git a/perftest_resources.c b/perftest_resources.c
diff --git a/perftest_resources.h b/perftest_resources.h
diff --git a/rdma_bw.c b/rdma_bw.c
diff --git a/rdma_lat.c b/rdma_lat.c
diff --git a/read_bw.c b/read_bw.c
diff --git a/read_lat.c b/read_lat.c
diff --git a/runme b/runme
diff --git a/send_bw.c b/send_bw.c
index 61ebb52..7d59d8a 100644
--- a/send_bw.c
+++ b/send_bw.c
@@ -1173,9 +1173,13 @@ int main(int argc, char *argv[])
 
 	// Should be a function over here that computes the inline.
 	context = ibv_open_device(ib_dev);
-	
+	if (!context) {
+		fprintf(stderr, "Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, "Failed to query device props");
+		fprintf(stderr, "Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408  ||
diff --git a/send_lat.c b/send_lat.c
diff --git a/write_bw.c b/write_bw.c
index 5851835..0f6ca17 100644
--- a/write_bw.c
+++ b/write_bw.c
@@ -773,8 +773,13 @@ int main(int argc, char *argv[])
 		return 7;
 
 	context = ibv_open_device(ib_dev);
+	if (!context) {
+		fprintf(stderr, " Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, " Failed to query device props");
+		fprintf(stderr, " Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408 ||
diff --git a/write_bw_postlist.c b/write_bw_postlist.c
index 0349c40..0350082 100644
--- a/write_bw_postlist.c
+++ b/write_bw_postlist.c
@@ -721,8 +721,13 @@ int main(int argc, char *argv[])
 	}
 
 	context = ibv_open_device(ib_dev);
+	if (!context) {
+		fprintf(stderr, "Failed to open device %s\n",
+				ibv_get_device_name(ib_dev));
+		return 1;
+	}
 	if (ibv_query_device(context, &device_attribute)) {
-		fprintf(stderr, "Failed to query device props");
+		fprintf(stderr, "Failed to query device props\n");
 		return 1;
 	}
 	if ((device_attribute.vendor_part_id == 25408 ||
diff --git a/write_lat.c b/write_lat.c

Reply via email to