mthca_align_qp_size(dev, qp); 
err = mthca_set_qp_size(dev, cap, qp); if (err) return err; 
int mthca_alloc_qp(struct mthca_dev *dev,		   struct mthca_pd *pd,		   struct mthca_cq *send_cq,		   struct mthca_cq *recv_cq,		   enum ib_qp_type type,		   enum ib_sig_type send_policy,		   struct mthca_qp *qp){	int err;	mthca_align_qp_size(dev, qp);	switch (type) {	case IB_QPT_RC: qp->transport = RC; break;	case IB_QPT_UC: qp->transport = UC; break;	case IB_QPT_UD: qp->transport = UD; break;	default: return -EINVAL;	}	qp->qpn = mthca_alloc(&dev->qp_table.alloc);	if (qp->qpn == -1)		return -ENOMEM;	err = mthca_alloc_qp_common(dev, pd, send_cq, recv_cq,				    send_policy, qp);	if (err) {		mthca_free(&dev->qp_table.alloc, qp->qpn);		return err;	}	spin_lock_irq(&dev->qp_table.lock);	mthca_array_set(&dev->qp_table.qp,			qp->qpn & (dev->limits.num_qps - 1), qp);	spin_unlock_irq(&dev->qp_table.lock);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/80c8ec2c04e539aac4e9810a46bc04c1b424b4dd/mthca_qp.c/buggy/drivers/infiniband/hw/mthca/mthca_qp.c