IB/ipath: Check that a UD work request's address handle is valid
authorRobert Walsh <robert.walsh@qlogic.com>
Thu, 15 Mar 2007 21:45:16 +0000 (14:45 -0700)
committerRoland Dreier <rolandd@cisco.com>
Thu, 19 Apr 2007 03:21:00 +0000 (20:21 -0700)
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_ud.c

index 57625b8..a518f7c 100644 (file)
@@ -308,6 +308,11 @@ int ipath_post_ud_send(struct ipath_qp *qp, struct ib_send_wr *wr)
                goto bail;
        }
 
+       if (wr->wr.ud.ah->pd != qp->ibqp.pd) {
+               ret = -EPERM;
+               goto bail;
+       }
+
        /* IB spec says that num_sge == 0 is OK. */
        if (wr->num_sge > qp->s_max_sge) {
                ret = -EINVAL;