diff options
author | Jack Morgenstein <jackm@mellanox.co.il> | 2006-03-22 08:52:31 +0100 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-25 00:47:29 +0100 |
commit | b3f64967fafad2d3487cdba18bc5166aec33a823 (patch) | |
tree | a0beb8a5ef4e0b9a30e5f456abc887d7af0391b1 /drivers/infiniband | |
parent | IB/mthca: Check SRQ limit in modify SRQ operation (diff) | |
download | linux-b3f64967fafad2d3487cdba18bc5166aec33a823.tar.xz linux-b3f64967fafad2d3487cdba18bc5166aec33a823.zip |
IB/mthca: Fix uninitialized variable in mthca_alloc_qp()
mthca_alloc_sqp() by mthca_set_qp_size() need to set qp->transport
before calling mthca_set_qp_size(), since the value is used there.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index c4b74dbc16f2..361c6ce3a9ff 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c @@ -1196,10 +1196,6 @@ int mthca_alloc_qp(struct mthca_dev *dev, { int err; - err = mthca_set_qp_size(dev, cap, pd, qp); - if (err) - return err; - switch (type) { case IB_QPT_RC: qp->transport = RC; break; case IB_QPT_UC: qp->transport = UC; break; @@ -1207,6 +1203,10 @@ int mthca_alloc_qp(struct mthca_dev *dev, default: return -EINVAL; } + err = mthca_set_qp_size(dev, cap, pd, qp); + if (err) + return err; + qp->qpn = mthca_alloc(&dev->qp_table.alloc); if (qp->qpn == -1) return -ENOMEM; @@ -1239,6 +1239,7 @@ int mthca_alloc_sqp(struct mthca_dev *dev, u32 mqpn = qpn * 2 + dev->qp_table.sqp_start + port - 1; int err; + sqp->qp.transport = MLX; err = mthca_set_qp_size(dev, cap, pd, &sqp->qp); if (err) return err; |