diff options
author | Dotan Barak <dotanb@dev.mellanox.co.il> | 2012-09-20 20:31:07 +0000 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-04-03 11:21:48 -0700 |
commit | 5fb42246f2b68f981b3facf97279dd93cdefc2f8 (patch) | |
tree | f28e262de68c5a921adc3e13d9925468eafff33c | |
parent | f1457e788c23f31e5aa78cbc002fd31baf61f6b4 (diff) | |
download | libmlx4-5fb42246f2b68f981b3facf97279dd93cdefc2f8.tar.gz |
Have ibv_modify_qp() return right value when ibv_query_port() fails
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 <dotanb@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | src/verbs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/verbs.c b/src/verbs.c index 443ba9d..7c5ee53 100644 --- a/src/verbs.c +++ b/src/verbs.c @@ -528,8 +528,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; } |