From: Wei Yongjun Subject: [PATCH] qedr: Fix missing unlock on error in qedr_post_send() Date: Fri, 28 Oct 2016 16:33:26 +0000 Message-ID: <1477672406-31487-1-git-send-email-weiyj.lk@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Doug Ledford , Sean Hefty , Hal Rosenstock , Ram Amrani , Rajesh Borundia Cc: Wei Yongjun , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org From: Wei Yongjun Add the missing unlock before return from function qedr_post_send() in the error handling case. Signed-off-by: Wei Yongjun --- drivers/infiniband/hw/qedr/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index a615142..e7c7417 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -2983,7 +2983,8 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, if (!wr) { DP_ERR(dev, "Got an empty post send.\n"); - return -EINVAL; + rc = -EINVAL; + goto out_unlock; } while (wr) { @@ -3012,6 +3013,7 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, /* Make sure write sticks */ mmiowb(); +out_unlock: spin_unlock_irqrestore(&qp->q_lock, flags); return rc; -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html