From: Dotan Barak <dot...@dev.mellanox.co.il>

When the ibv_query_port() call made by mlx4_modify_qp() fails, the return
value from the latter should indicate the error status of the former and
not simply -1.

Signed-off-by: Dotan Barak <dot...@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerl...@mellanox.com>
---
 src/verbs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/verbs.c b/src/verbs.c
index f629275..fb73fdc 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -534,8 +534,10 @@ int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr 
*attr,
        int ret;
 
        if (attr_mask & IBV_QP_PORT) {
-               if (ibv_query_port(qp->pd->context, attr->port_num, &port_attr))
-                       return -1;
+               ret = ibv_query_port(qp->pd->context, attr->port_num,
+                                    &port_attr);
+               if (ret)
+                       return ret;
                mqp->link_layer = port_attr.link_layer;
        }
 
-- 
1.7.1

--
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