aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_verbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_verbs.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_verbs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index cda8f4173d23..9fab40488850 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -550,10 +550,12 @@ static void qib_qp_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
550{ 550{
551 struct qib_ibport *ibp = &rcd->ppd->ibport_data; 551 struct qib_ibport *ibp = &rcd->ppd->ibport_data;
552 552
553 spin_lock(&qp->r_lock);
554
553 /* Check for valid receive state. */ 555 /* Check for valid receive state. */
554 if (!(ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) { 556 if (!(ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) {
555 ibp->n_pkt_drops++; 557 ibp->n_pkt_drops++;
556 return; 558 goto unlock;
557 } 559 }
558 560
559 switch (qp->ibqp.qp_type) { 561 switch (qp->ibqp.qp_type) {
@@ -577,6 +579,9 @@ static void qib_qp_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
577 default: 579 default:
578 break; 580 break;
579 } 581 }
582
583unlock:
584 spin_unlock(&qp->r_lock);
580} 585}
581 586
582/** 587/**