Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7be05753 authored by Selvin Xavier's avatar Selvin Xavier Committed by Doug Ledford
Browse files

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.

Fixes: d4186194 ("Add generic function to extract IB speed from netdev")
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 0c98568c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ 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,
		if (ib_get_eth_speed(ibdev, port_num, &port_attr->active_speed,
				     &port_attr->active_width))
			return -EINVAL;
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ 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,
	if (ib_get_eth_speed(ibdev, port, &props->active_speed,
			     &props->active_width)) {
		mutex_unlock(&us_ibdev->usdev_lock);
		return -EINVAL;