RDMA: Fix return value check for ib_get_eth_speed()
PATCH v2 1/1 RDMA: Fix return value check for ib_get_eth_speed()
ib_get_eth_speed() return 0 on success. Fixing the condition checking and prevent reporting failure for query_port verb.
---
v1 -> v2:
Fixing the commit log. Also, fixes the same issue in usnic driver also
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +2 -2
@@ -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 ; }
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +2 -2
@@ -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 ; }
Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Leon Romanovsky
Reviewed-byQuoted 12 lines · Selvin Xavier
ib_get_eth_speed()return 0 on success. Fixing the condition checking and prevent reporting failure forquery_portverb.Fixes d41861942fc5 ("Add generic function to extract IB speed from netdev")---
v1 -> v2:
Fixing the commit log. Also, fixes the same issue in usnic driver alsodrivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Thanks,
Yuval Shaia
Reviewed-byQuoted 4 lines · Selvin Xavier
ib_get_eth_speed()return 0 on success. Fixing the condition checking and prevent reporting failure forquery_portverb.Fixes d41861942fc5 ("Add generic function to extract IB speed from netdev")
oops
Quoted 45 lines
---
v1 -> v2:
Fixing the commit log. Also, fixes the same issue in usnic driver alsodrivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++-- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/infiniband/hw/bnxt_re/ib_verbs.c +2
-2@@ -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 ; }drivers/infiniband/hw/usnic/usnic_ib_verbs.c +2
-2@@ -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 ; }Signature · 6 lines
2.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Doug Ledford
AppliedQuoted 6 lines · Selvin Xavier
ib_get_eth_speed()return 0 on success. Fixing the condition checking and prevent reporting failure forquery_portverb.Fixes d41861942fc5 ("Add generic function to extract IB speed fromnetdev")
Thanks, applied.
Signature · 8 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html