the dev_list pointer is allocated, incremented and then freed.

Signed-off-by: Eli Cohen <[EMAIL PROTECTED]>

---

Index: libibverbs/examples/srq_pingpong.c
===================================================================
--- libibverbs.orig/examples/srq_pingpong.c     2007-05-31 15:18:10.000000000 
+0300
+++ libibverbs/examples/srq_pingpong.c  2007-05-31 15:21:47.000000000 +0300
@@ -549,7 +549,7 @@ static void usage(const char *argv0)
 
 int main(int argc, char *argv[])
 {
-       struct ibv_device      **dev_list;
+       struct ibv_device      **dev_list, **__dev_list;
        struct ibv_device       *ib_dev;
        struct ibv_wc           *wc;
        struct pingpong_context *ctx;
@@ -668,7 +668,7 @@ int main(int argc, char *argv[])
 
        page_size = sysconf(_SC_PAGESIZE);
 
-       dev_list = ibv_get_device_list(NULL);
+       dev_list = __dev_list = ibv_get_device_list(NULL);
        if (!dev_list) {
                fprintf(stderr, "No IB devices found\n");
                return 1;
@@ -863,7 +863,7 @@ int main(int argc, char *argv[])
        if (pp_close_ctx(ctx, num_qp))
                return 1;
 
-       ibv_free_device_list(dev_list);
+       ibv_free_device_list(__dev_list);
        free(rem_dest);
 
        return 0;

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to