[ofa-general] [PATCH] rdma_cm: fix port type (fix bug 557)

Yosef Etigin yosefe at voltaire.com
Mon Jun 4 10:20:56 PDT 2007


This fixes bug 557 <https://bugs.openfabrics.org/show_bug.cgi?id=557>

If next_port is signed int, and is randomized to be negative, it will fail
accesses to the idr data structure and therefore cause errors in rdma_cm users.

Signed-off-by: Yosef Etigin <yosefe at voltaire.com>

--
diff -urN ofa_kernel-1.2/drivers/infiniband/core/cma.c ofa_kernel-1.2.b/drivers/infiniband/core/cma.c
--- ofa_kernel-1.2/drivers/infiniband/core/cma.c	2007-06-04 20:12:12.000000000 +0300
+++ ofa_kernel-1.2.b/drivers/infiniband/core/cma.c	2007-06-04 20:14:27.000000000 +0300
@@ -77,7 +77,7 @@
 static DEFINE_IDR(tcp_ps);
 static DEFINE_IDR(udp_ps);
 static DEFINE_IDR(ipoib_ps);
-static int next_port;
+static unsigned next_port;
 
 struct cma_device {
 	struct list_head	list;



More information about the general mailing list