diff options
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index b5a24fbef70d..f6315dfb213e 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -415,9 +415,11 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd, | |||
415 | return 0; | 415 | return 0; |
416 | 416 | ||
417 | err_wrid: | 417 | err_wrid: |
418 | if (pd->uobject && !init_attr->srq) | 418 | if (pd->uobject) { |
419 | mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context), &qp->db); | 419 | if (!init_attr->srq) |
420 | else { | 420 | mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context), |
421 | &qp->db); | ||
422 | } else { | ||
421 | kfree(qp->sq.wrid); | 423 | kfree(qp->sq.wrid); |
422 | kfree(qp->rq.wrid); | 424 | kfree(qp->rq.wrid); |
423 | } | 425 | } |
@@ -742,7 +744,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
742 | if (attr->path_mtu < IB_MTU_256 || attr->path_mtu > IB_MTU_4096) { | 744 | if (attr->path_mtu < IB_MTU_256 || attr->path_mtu > IB_MTU_4096) { |
743 | printk(KERN_ERR "path MTU (%u) is invalid\n", | 745 | printk(KERN_ERR "path MTU (%u) is invalid\n", |
744 | attr->path_mtu); | 746 | attr->path_mtu); |
745 | return -EINVAL; | 747 | goto out; |
746 | } | 748 | } |
747 | context->mtu_msgmax = (attr->path_mtu << 5) | 31; | 749 | context->mtu_msgmax = (attr->path_mtu << 5) | 31; |
748 | } | 750 | } |
@@ -781,10 +783,8 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
781 | 783 | ||
782 | if (attr_mask & IB_QP_AV) { | 784 | if (attr_mask & IB_QP_AV) { |
783 | if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path, | 785 | if (mlx4_set_path(dev, &attr->ah_attr, &context->pri_path, |
784 | attr_mask & IB_QP_PORT ? attr->port_num : qp->port)) { | 786 | attr_mask & IB_QP_PORT ? attr->port_num : qp->port)) |
785 | err = -EINVAL; | ||
786 | goto out; | 787 | goto out; |
787 | } | ||
788 | 788 | ||
789 | optpar |= (MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH | | 789 | optpar |= (MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH | |
790 | MLX4_QP_OPTPAR_SCHED_QUEUE); | 790 | MLX4_QP_OPTPAR_SCHED_QUEUE); |
@@ -798,15 +798,15 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, | |||
798 | if (attr_mask & IB_QP_ALT_PATH) { | 798 | if (attr_mask & IB_QP_ALT_PATH) { |
799 | if (attr->alt_port_num == 0 || | 799 | if (attr->alt_port_num == 0 || |
800 | attr->alt_port_num > dev->dev->caps.num_ports) | 800 | attr->alt_port_num > dev->dev->caps.num_ports) |
801 | return -EINVAL; | 801 | goto out; |
802 | 802 | ||
803 | if (attr->alt_pkey_index >= | 803 | if (attr->alt_pkey_index >= |
804 | dev->dev->caps.pkey_table_len[attr->alt_port_num]) | 804 | dev->dev->caps.pkey_table_len[attr->alt_port_num]) |
805 | return -EINVAL; | 805 | goto out; |
806 | 806 | ||
807 | if (mlx4_set_path(dev, &attr->alt_ah_attr, &context->alt_path, | 807 | if (mlx4_set_path(dev, &attr->alt_ah_attr, &context->alt_path, |
808 | attr->alt_port_num)) | 808 | attr->alt_port_num)) |
809 | return -EINVAL; | 809 | goto out; |
810 | 810 | ||
811 | context->alt_path.pkey_index = attr->alt_pkey_index; | 811 | context->alt_path.pkey_index = attr->alt_pkey_index; |
812 | context->alt_path.ackto = attr->alt_timeout << 3; | 812 | context->alt_path.ackto = attr->alt_timeout << 3; |