 qp->sq.max    = init_attr->cap.max_send_wr; qp->rq.max    = init_attr->cap.max_recv_wr; qp->sq.max_gs = init_attr->cap.max_send_sge; qp->rq.max_gs = init_attr->cap.max_recv_sge; 
static struct ib_qp *mthca_create_qp(struct ib_pd *pd,				     struct ib_qp_init_attr *init_attr,				     struct ib_udata *udata){	struct mthca_qp *qp;	int err;	switch (init_attr->qp_type) {	case IB_QPT_RC:	case IB_QPT_UC:	case IB_QPT_UD:	{		qp = kmalloc(sizeof *qp, GFP_KERNEL);		if (!qp)			return ERR_PTR(-ENOMEM);		qp->sq.max    = init_attr->cap.max_send_wr;		qp->rq.max    = init_attr->cap.max_recv_wr;		qp->sq.max_gs = init_attr->cap.max_send_sge;		qp->rq.max_gs = init_attr->cap.max_recv_sge;		err = mthca_alloc_qp(to_mdev(pd->device), to_mpd(pd),				     to_mcq(init_attr->send_cq),				     to_mcq(init_attr->recv_cq),				     init_attr->qp_type, init_attr->sq_sig_type,				     qp);		qp->ibqp.qp_num = qp->qpn;		break;	}	case IB_QPT_SMI:	case IB_QPT_GSI:	{		qp = kmalloc(sizeof (struct mthca_sqp), GFP_KERNEL);		if (!qp)			return ERR_PTR(-ENOMEM);		qp->sq.max    = init_attr->cap.max_send_wr;		qp->rq.max    = init_attr->cap.max_recv_wr;		qp->sq.max_gs = init_attr->cap.max_send_sge;		qp->rq.max_gs = init_attr->cap.max_recv_sge;		qp->ibqp.qp_num = init_attr->qp_type == IB_QPT_SMI ? 0 : 1;		err = mthca_alloc_sqp(to_mdev(pd->device), to_mpd(pd),				      to_mcq(init_attr->send_cq),				      to_mcq(init_attr->recv_cq),				      init_attr->sq_sig_type,				      qp->ibqp.qp_num, init_attr->port_num,				      to_msqp(qp));		break;	}	default:		/* Don't support raw QPs */		return ERR_PTR(-ENOSYS);	}	if (err) {		kfree(qp);		return ERR_PTR(err);	}        init_attr->cap.max_inline_data = 0;	return &qp->ibqp;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/80c8ec2c04e539aac4e9810a46bc04c1b424b4dd/mthca_provider.c/buggy/drivers/infiniband/hw/mthca/mthca_provider.c