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>
This commit is contained in:
Jack Morgenstein 2006-03-22 09:52:31 +02:00 committed by Roland Dreier
parent d4301e2c66
commit b3f64967fa

View File

@ -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;