diff options
author | Naresh Gottumukkala <bgottumukkala@emulex.com> | 2013-06-10 00:42:40 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-06-20 07:52:14 -0400 |
commit | f6ddcf71070d01a7bb34818dd3aaf4bdac5386fa (patch) | |
tree | 82ae24cc56ef99f4d3058244fee6f1bcc8aebcfc /drivers/infiniband/hw | |
parent | ef99c4c2ed63cb0deb94ea70fb47c2d6294e302e (diff) |
RDMA/ocrdma: Set bad_wr in error case
Fix post_send to set the bad_wr in error case.
Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 882a8198d820..06215301a675 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
@@ -1734,12 +1734,14 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
1734 | spin_lock_irqsave(&qp->q_lock, flags); | 1734 | spin_lock_irqsave(&qp->q_lock, flags); |
1735 | if (qp->state != OCRDMA_QPS_RTS && qp->state != OCRDMA_QPS_SQD) { | 1735 | if (qp->state != OCRDMA_QPS_RTS && qp->state != OCRDMA_QPS_SQD) { |
1736 | spin_unlock_irqrestore(&qp->q_lock, flags); | 1736 | spin_unlock_irqrestore(&qp->q_lock, flags); |
1737 | *bad_wr = wr; | ||
1737 | return -EINVAL; | 1738 | return -EINVAL; |
1738 | } | 1739 | } |
1739 | 1740 | ||
1740 | while (wr) { | 1741 | while (wr) { |
1741 | if (ocrdma_hwq_free_cnt(&qp->sq) == 0 || | 1742 | if (ocrdma_hwq_free_cnt(&qp->sq) == 0 || |
1742 | wr->num_sge > qp->sq.max_sges) { | 1743 | wr->num_sge > qp->sq.max_sges) { |
1744 | *bad_wr = wr; | ||
1743 | status = -ENOMEM; | 1745 | status = -ENOMEM; |
1744 | break; | 1746 | break; |
1745 | } | 1747 | } |