infiniband: Fix up module files that need to include module.h
[deliverable/linux.git] / drivers / infiniband / hw / qib / qib_verbs.c
index cda8f4173d232d12adc05dd5e53aef6b5c0b2c51..1d24652b2c390f1d26ba0240a05500ac89934668 100644 (file)
@@ -35,6 +35,7 @@
 #include <rdma/ib_mad.h>
 #include <rdma/ib_user_verbs.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/utsname.h>
 #include <linux/rculist.h>
 #include <linux/mm.h>
@@ -550,10 +551,12 @@ static void qib_qp_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
 {
        struct qib_ibport *ibp = &rcd->ppd->ibport_data;
 
+       spin_lock(&qp->r_lock);
+
        /* Check for valid receive state. */
        if (!(ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) {
                ibp->n_pkt_drops++;
-               return;
+               goto unlock;
        }
 
        switch (qp->ibqp.qp_type) {
@@ -577,6 +580,9 @@ static void qib_qp_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
        default:
                break;
        }
+
+unlock:
+       spin_unlock(&qp->r_lock);
 }
 
 /**
This page took 0.029045 seconds and 5 git commands to generate.