diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 9125e02eadaf..6a4a5e3b78ba 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -748,19 +748,25 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
748 | struct ib_qp *ret; | 748 | struct ib_qp *ret; |
749 | 749 | ||
750 | if (init_attr->cap.max_send_sge > ib_ipath_max_sges || | 750 | if (init_attr->cap.max_send_sge > ib_ipath_max_sges || |
751 | init_attr->cap.max_recv_sge > ib_ipath_max_sges || | 751 | init_attr->cap.max_send_wr > ib_ipath_max_qp_wrs) { |
752 | init_attr->cap.max_send_wr > ib_ipath_max_qp_wrs || | 752 | ret = ERR_PTR(-EINVAL); |
753 | init_attr->cap.max_recv_wr > ib_ipath_max_qp_wrs) { | ||
754 | ret = ERR_PTR(-ENOMEM); | ||
755 | goto bail; | 753 | goto bail; |
756 | } | 754 | } |
757 | 755 | ||
758 | if (init_attr->cap.max_send_sge + | 756 | /* Check receive queue parameters if no SRQ is specified. */ |
759 | init_attr->cap.max_recv_sge + | 757 | if (!init_attr->srq) { |
760 | init_attr->cap.max_send_wr + | 758 | if (init_attr->cap.max_recv_sge > ib_ipath_max_sges || |
761 | init_attr->cap.max_recv_wr == 0) { | 759 | init_attr->cap.max_recv_wr > ib_ipath_max_qp_wrs) { |
762 | ret = ERR_PTR(-EINVAL); | 760 | ret = ERR_PTR(-EINVAL); |
763 | goto bail; | 761 | goto bail; |
762 | } | ||
763 | if (init_attr->cap.max_send_sge + | ||
764 | init_attr->cap.max_send_wr + | ||
765 | init_attr->cap.max_recv_sge + | ||
766 | init_attr->cap.max_recv_wr == 0) { | ||
767 | ret = ERR_PTR(-EINVAL); | ||
768 | goto bail; | ||
769 | } | ||
764 | } | 770 | } |
765 | 771 | ||
766 | switch (init_attr->qp_type) { | 772 | switch (init_attr->qp_type) { |