We special case port == 0 to mean all ports, and it's the default,
so if a user passes in 0, they likely meant 1 instead.  Throw an
error because they probably didn't mean to specify the default
behavior of scan all ports.  Path of least surprise and all that.

Signed-off-by: Doug Ledford <dledf...@redhat.com>
---
 examples/devinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/examples/devinfo.c b/examples/devinfo.c
index b1a3b2e..d6e9218 100644
--- a/examples/devinfo.c
+++ b/examples/devinfo.c
@@ -385,7 +385,7 @@ int main(int argc, char *argv[])
 
                case 'i':
                        ib_port = strtol(optarg, NULL, 0);
-                       if (ib_port < 0) {
+                       if (ib_port <= 0) {
                                usage(argv[0]);
                                return 1;
                        }
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to