Always set ib_post_recv()'s bad_wr when an error occurred.

Signed-off-by: Frank Zago <[email protected]>
---
 drivers/infiniband/hw/amso1100/c2_qp.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6.31/drivers/infiniband/hw/amso1100/c2_qp.c
===================================================================
--- linux-2.6.31.orig/drivers/infiniband/hw/amso1100/c2_qp.c    2009-12-02
19:23:17.000000000 -0600
+++ linux-2.6.31/drivers/infiniband/hw/amso1100/c2_qp.c 2009-12-02
19:23:23.000000000 -0600
@@ -947,8 +947,10 @@
        unsigned long lock_flags;
        int err = 0;

-       if (qp->state > IB_QPS_RTS)
-               return -EINVAL;
+       if (qp->state > IB_QPS_RTS) {
+               err = -EINVAL;
+               goto out;
+       }

        /*
         * Try and post each work request
@@ -1001,6 +1003,7 @@
                ib_wr = ib_wr->next;
        }

+out:
        if (err)
                *bad_wr = ib_wr;
        return err;

-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to