diff options
| author | Frank Zago <frank@zago.net> | 2009-12-09 17:56:11 -0500 |
|---|---|---|
| committer | Roland Dreier <rolandd@cisco.com> | 2009-12-09 17:56:11 -0500 |
| commit | c597b0240b686427248b6d4fc8adbe22f9a04c11 (patch) | |
| tree | f06d1efd1944b7500dbda4fa748de1f4ea80f4a1 | |
| parent | 91d3f9bacdb4950d2f79fe2ba296aa249f60d06c (diff) | |
RDMA/amso1100: Fix error paths in post_send and post_recv
Always set bad_wr when an immediate error is detected.
Signed-off-by: Frank Zago <fzago@systemfabricworks.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
| -rw-r--r-- | drivers/infiniband/hw/amso1100/c2_qp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c index a6d89440ad2c..ad518868df77 100644 --- a/drivers/infiniband/hw/amso1100/c2_qp.c +++ b/drivers/infiniband/hw/amso1100/c2_qp.c | |||
| @@ -798,8 +798,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, | |||
| 798 | u8 actual_sge_count; | 798 | u8 actual_sge_count; |
| 799 | u32 msg_size; | 799 | u32 msg_size; |
| 800 | 800 | ||
| 801 | if (qp->state > IB_QPS_RTS) | 801 | if (qp->state > IB_QPS_RTS) { |
| 802 | return -EINVAL; | 802 | err = -EINVAL; |
| 803 | goto out; | ||
| 804 | } | ||
| 803 | 805 | ||
| 804 | while (ib_wr) { | 806 | while (ib_wr) { |
| 805 | 807 | ||
| @@ -930,6 +932,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, | |||
| 930 | ib_wr = ib_wr->next; | 932 | ib_wr = ib_wr->next; |
| 931 | } | 933 | } |
| 932 | 934 | ||
| 935 | out: | ||
| 933 | if (err) | 936 | if (err) |
| 934 | *bad_wr = ib_wr; | 937 | *bad_wr = ib_wr; |
| 935 | return err; | 938 | return err; |
| @@ -944,8 +947,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, | |||
| 944 | unsigned long lock_flags; | 947 | unsigned long lock_flags; |
| 945 | int err = 0; | 948 | int err = 0; |
| 946 | 949 | ||
| 947 | if (qp->state > IB_QPS_RTS) | 950 | if (qp->state > IB_QPS_RTS) { |
| 948 | return -EINVAL; | 951 | err = -EINVAL; |
| 952 | goto out; | ||
| 953 | } | ||
| 949 | 954 | ||
| 950 | /* | 955 | /* |
| 951 | * Try and post each work request | 956 | * 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 | ib_wr = ib_wr->next; | 1003 | ib_wr = ib_wr->next; |
| 999 | } | 1004 | } |
| 1000 | 1005 | ||
| 1006 | out: | ||
| 1001 | if (err) | 1007 | if (err) |
| 1002 | *bad_wr = ib_wr; | 1008 | *bad_wr = ib_wr; |
| 1003 | return err; | 1009 | return err; |
