[ofw] [PATCH] [ib-diag] ibstat: port_dump is called too many times

Sean Hefty sean.hefty at intel.com
Tue Mar 3 13:15:59 PST 2009


portnum index should go from 0 to numports - 1.  This fixes an
issue on WinOF where a bogus last port is displayed.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---

 infiniband-diags/src/ibstat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/infiniband-diags/src/ibstat.c b/infiniband-diags/src/ibstat.c
index 7985be1..41faea8 100644
--- a/infiniband-diags/src/ibstat.c
+++ b/infiniband-diags/src/ibstat.c
@@ -146,7 +146,7 @@ ca_stat(char *ca_name, int portnum, int no_ports)
 	if (no_ports)
 		return 0;
 
-	for (portnum = 0; portnum <= ca.numports; portnum++)
+	for (portnum = 0; portnum < ca.numports; portnum++)
 		port_dump(ca.ports[portnum], 0);
 
 	return 0;






More information about the ofw mailing list