aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@mellanox.co.il>2006-03-22 02:52:31 -0500
committerRoland Dreier <rolandd@cisco.com>2006-03-24 18:47:29 -0500
commitb3f64967fafad2d3487cdba18bc5166aec33a823 (patch)
treea0beb8a5ef4e0b9a30e5f456abc887d7af0391b1 /drivers/infiniband/hw
parentd4301e2c6685c87206f24f54969120b182119ab0 (diff)
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/hw')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c9
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,
1196{ 1196{
1197 int err; 1197 int err;
1198 1198
1199 err = mthca_set_qp_size(dev, cap, pd, qp);
1200 if (err)
1201 return err;
1202
1203 switch (type) { 1199 switch (type) {
1204 case IB_QPT_RC: qp->transport = RC; break; 1200 case IB_QPT_RC: qp->transport = RC; break;
1205 case IB_QPT_UC: qp->transport = UC; break; 1201 case IB_QPT_UC: qp->transport = UC; break;
@@ -1207,6 +1203,10 @@ int mthca_alloc_qp(struct mthca_dev *dev,
1207 default: return -EINVAL; 1203 default: return -EINVAL;
1208 } 1204 }
1209 1205
1206 err = mthca_set_qp_size(dev, cap, pd, qp);
1207 if (err)
1208 return err;
1209
1210 qp->qpn = mthca_alloc(&dev->qp_table.alloc); 1210 qp->qpn = mthca_alloc(&dev->qp_table.alloc);
1211 if (qp->qpn == -1) 1211 if (qp->qpn == -1)
1212 return -ENOMEM; 1212 return -ENOMEM;
@@ -1239,6 +1239,7 @@ int mthca_alloc_sqp(struct mthca_dev *dev,
1239 u32 mqpn = qpn * 2 + dev->qp_table.sqp_start + port - 1; 1239 u32 mqpn = qpn * 2 + dev->qp_table.sqp_start + port - 1;
1240 int err; 1240 int err;
1241 1241
1242 sqp->qp.transport = MLX;
1242 err = mthca_set_qp_size(dev, cap, pd, &sqp->qp); 1243 err = mthca_set_qp_size(dev, cap, pd, &sqp->qp);
1243 if (err) 1244 if (err)
1244 return err; 1245 return err;