diff options
author | Pete Wyckoff <pw@osc.edu> | 2005-08-26 17:09:17 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 11:35:57 -0800 |
commit | c3e80354b4153374aed3efe11a288f5ae039470d (patch) | |
tree | 365418a2d53b66c6009e0dd7353f204d8c13f7fe | |
parent | 6d3ded7bc2108634bf6ab4865dbcda53d7924b8b (diff) | |
download | libibverbs-c3e80354b4153374aed3efe11a288f5ae039470d.tar.gz |
Avoid segv when no IB devices are found
Signed-off-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | examples/asyncwatch.c | 6 | ||||
-rw-r--r-- | examples/device_list.c | 4 | ||||
-rw-r--r-- | examples/devinfo.c | 4 | ||||
-rw-r--r-- | examples/rc_pingpong.c | 4 | ||||
-rw-r--r-- | examples/srq_pingpong.c | 4 | ||||
-rw-r--r-- | examples/uc_pingpong.c | 4 | ||||
-rw-r--r-- | examples/ud_pingpong.c | 4 |
9 files changed, 32 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 6c135fb..c3fa3f1 100644 --- a/configure.in +++ b/configure.in @@ -1,11 +1,11 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(libibverbs, 0.1.0, openib-general@openib.org) +AC_INIT(libibverbs, 1.0-rc1, openib-general@openib.org) AC_CONFIG_SRCDIR([src/ibverbs.h]) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libibverbs, 0.1.0) +AM_INIT_AUTOMAKE(libibverbs, 1.0-rc1) AM_PROG_LIBTOOL diff --git a/debian/changelog b/debian/changelog index 27da54c..59f12ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libibverbs (0.1.0-1) unstable; urgency=low +libibverbs (1.0-rc1) unstable; urgency=low * Initial Release. diff --git a/examples/asyncwatch.c b/examples/asyncwatch.c index add05f3..d06d04f 100644 --- a/examples/asyncwatch.c +++ b/examples/asyncwatch.c @@ -29,7 +29,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * - * $Id: device_list.c 1393 2004-12-28 02:15:24Z roland $ + * $Id$ */ #if HAVE_CONFIG_H @@ -56,6 +56,10 @@ int main(int argc, char *argv[]) struct ibv_async_event event; dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); ib_dev = dlist_next(dev_list); diff --git a/examples/device_list.c b/examples/device_list.c index 414612e..37f3a40 100644 --- a/examples/device_list.c +++ b/examples/device_list.c @@ -55,6 +55,10 @@ int main(int argc, char *argv[]) struct ibv_device *ib_dev; dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } printf(" %-16s\t node GUID\n", "device"); printf(" %-16s\t----------------\n", "------"); diff --git a/examples/devinfo.c b/examples/devinfo.c index 0238ec7..e0a0f66 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -58,6 +58,10 @@ int main(int argc, char *argv[]) int i; dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); ib_dev = dlist_next(dev_list); diff --git a/examples/rc_pingpong.c b/examples/rc_pingpong.c index 7e20917..65ab080 100644 --- a/examples/rc_pingpong.c +++ b/examples/rc_pingpong.c @@ -524,6 +524,10 @@ int main(int argc, char *argv[]) page_size = sysconf(_SC_PAGESIZE); dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); if (!ib_devname) { diff --git a/examples/srq_pingpong.c b/examples/srq_pingpong.c index 8170f56..deb1699 100644 --- a/examples/srq_pingpong.c +++ b/examples/srq_pingpong.c @@ -593,6 +593,10 @@ int main(int argc, char *argv[]) page_size = sysconf(_SC_PAGESIZE); dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); if (!ib_devname) { diff --git a/examples/uc_pingpong.c b/examples/uc_pingpong.c index 7dcdbc3..6d3e80a 100644 --- a/examples/uc_pingpong.c +++ b/examples/uc_pingpong.c @@ -516,6 +516,10 @@ int main(int argc, char *argv[]) page_size = sysconf(_SC_PAGESIZE); dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); if (!ib_devname) { diff --git a/examples/ud_pingpong.c b/examples/ud_pingpong.c index e7704e3..23fe25d 100644 --- a/examples/ud_pingpong.c +++ b/examples/ud_pingpong.c @@ -520,6 +520,10 @@ int main(int argc, char *argv[]) page_size = sysconf(_SC_PAGESIZE); dev_list = ibv_get_devices(); + if (!dev_list) { + fprintf(stderr, "No IB devices found\n"); + return 1; + } dlist_start(dev_list); if (!ib_devname) { |