RDMA: Fix return value check for ib_get_eth_speed()
authorSelvin Xavier <selvin.xavier@broadcom.com>
Thu, 17 Aug 2017 14:58:07 +0000 (07:58 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 22 Aug 2017 20:23:25 +0000 (16:23 -0400)
ib_get_eth_speed() return 0 on success. Fixing the condition checking
and prevent reporting failure for query_port verb.

Fixes: d41861942fc5 ("Add generic function to extract IB speed from netdev")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/usnic/usnic_ib_verbs.c

index 24e2785774b81b55103fced4afd46ad0c681c76c..43b3dee4b6ba5a90e89a5345ae404209cb4cafe6 100644 (file)
@@ -264,8 +264,8 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num,
         * IB stack to avoid race in the NETDEV_UNREG path
         */
        if (test_bit(BNXT_RE_FLAG_IBDEV_REGISTERED, &rdev->flags))
-               if (!ib_get_eth_speed(ibdev, port_num, &port_attr->active_speed,
-                                     &port_attr->active_width))
+               if (ib_get_eth_speed(ibdev, port_num, &port_attr->active_speed,
+                                    &port_attr->active_width))
                        return -EINVAL;
        return 0;
 }
index e5f57dd4998063f6a5288190e5caa2a255280fc7..97dd79ebb5905c27c73bdd4681ae0dd18fbc64f0 100644 (file)
@@ -309,8 +309,8 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
        usnic_dbg("\n");
 
        mutex_lock(&us_ibdev->usdev_lock);
-       if (!ib_get_eth_speed(ibdev, port, &props->active_speed,
-                             &props->active_width)) {
+       if (ib_get_eth_speed(ibdev, port, &props->active_speed,
+                            &props->active_width)) {
                mutex_unlock(&us_ibdev->usdev_lock);
                return -EINVAL;
        }