]> err.no Git - linux-2.6/commitdiff
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 57625b8c1b97affd8f67dfe9f44e8e712cd4a7bd..a518f7c8fa83a9372fc9a5327e646825876261bf 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;