Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6ddcf71 authored by Naresh Gottumukkala's avatar Naresh Gottumukkala Committed by Roland Dreier
Browse files

RDMA/ocrdma: Set bad_wr in error case



Fix post_send to set the bad_wr in error case.

Signed-off-by: default avatarNaresh Gottumukkala <bgottumukkala@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent ef99c4c2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1734,12 +1734,14 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
	spin_lock_irqsave(&qp->q_lock, flags);
	if (qp->state != OCRDMA_QPS_RTS && qp->state != OCRDMA_QPS_SQD) {
		spin_unlock_irqrestore(&qp->q_lock, flags);
		*bad_wr = wr;
		return -EINVAL;
	}

	while (wr) {
		if (ocrdma_hwq_free_cnt(&qp->sq) == 0 ||
		    wr->num_sge > qp->sq.max_sges) {
			*bad_wr = wr;
			status = -ENOMEM;
			break;
		}