summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_qp.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-07-01 04:35:55 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 09:55:59 -0700
commit4a45b7d4ece0e6dc425e9f66fa8b501b72d846db (patch)
tree6e858b3343ffb3670eb6f5a838479d52791e0a30 /drivers/infiniband/hw/ipath/ipath_qp.c
parent6665ddee85bfc336d691ea5132a2c20a1d0e8053 (diff)
[PATCH] IB/ipath: don't allow resources to be created with illegal values
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Cc: "Michael S. Tsirkin" <mst@mellanox.co.il> Cc: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 47271be65b0..e6fc4c02823 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -667,6 +667,14 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
goto bail;
}
+ if (init_attr->cap.max_send_sge +
+ init_attr->cap.max_recv_sge +
+ init_attr->cap.max_send_wr +
+ init_attr->cap.max_recv_wr == 0) {
+ ret = ERR_PTR(-EINVAL);
+ goto bail;
+ }
+
switch (init_attr->qp_type) {
case IB_QPT_UC:
case IB_QPT_RC: