Commit c597b024 authored by Frank Zago's avatar Frank Zago Committed by Roland Dreier

RDMA/amso1100: Fix error paths in post_send and post_recv

Always set bad_wr when an immediate error is detected.
Signed-off-by: default avatarFrank Zago <fzago@systemfabricworks.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 91d3f9ba
...@@ -798,8 +798,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, ...@@ -798,8 +798,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
u8 actual_sge_count; u8 actual_sge_count;
u32 msg_size; u32 msg_size;
if (qp->state > IB_QPS_RTS) if (qp->state > IB_QPS_RTS) {
return -EINVAL; err = -EINVAL;
goto out;
}
while (ib_wr) { while (ib_wr) {
...@@ -930,6 +932,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, ...@@ -930,6 +932,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
ib_wr = ib_wr->next; ib_wr = ib_wr->next;
} }
out:
if (err) if (err)
*bad_wr = ib_wr; *bad_wr = ib_wr;
return err; return err;
...@@ -944,8 +947,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, ...@@ -944,8 +947,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
unsigned long lock_flags; unsigned long lock_flags;
int err = 0; int err = 0;
if (qp->state > IB_QPS_RTS) if (qp->state > IB_QPS_RTS) {
return -EINVAL; err = -EINVAL;
goto out;
}
/* /*
* Try and post each work request * Try and post each work request
...@@ -998,6 +1003,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, ...@@ -998,6 +1003,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
ib_wr = ib_wr->next; ib_wr = ib_wr->next;
} }
out:
if (err) if (err)
*bad_wr = ib_wr; *bad_wr = ib_wr;
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment