ib-diags: fix portnum being off by 1
[mirror/winof/.git] / tools / infiniband-diags / src / ibstat.c
index 7985be1..41faea8 100644 (file)
@@ -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;