dev_lim->cqc_entry_sz, mdev->limits.num_cqs, mdev->limits.reserved_cqs, 0); 
dev_lim->cqc_entry_sz, mdev->limits.num_cqs, mdev->limits.reserved_cqs, 0); 
static int __devinit mthca_init_icm(struct mthca_dev *mdev,				    struct mthca_dev_lim *dev_lim,				    struct mthca_init_hca_param *init_hca,				    u64 icm_size){	u64 aux_pages;	u8 status;	int err;	err = mthca_SET_ICM_SIZE(mdev, icm_size, &aux_pages, &status);	if (err) {		mthca_err(mdev, "SET_ICM_SIZE command failed, aborting.\n");		return err;	}	if (status) {		mthca_err(mdev, "SET_ICM_SIZE returned status 0x%02x, "			  "aborting.\n", status);		return -EINVAL;	}	mthca_dbg(mdev, "%lld KB of HCA context requires %lld KB aux memory.\n",		  (unsigned long long) icm_size >> 10,		  (unsigned long long) aux_pages << 2);	mdev->fw.arbel.aux_icm = mthca_alloc_icm(mdev, aux_pages,						 GFP_HIGHUSER | __GFP_NOWARN);	if (!mdev->fw.arbel.aux_icm) {		mthca_err(mdev, "Couldn't allocate aux memory, aborting.\n");		return -ENOMEM;	}	err = mthca_MAP_ICM_AUX(mdev, mdev->fw.arbel.aux_icm, &status);	if (err) {		mthca_err(mdev, "MAP_ICM_AUX command failed, aborting.\n");		goto err_free_aux;	}	if (status) {		mthca_err(mdev, "MAP_ICM_AUX returned status 0x%02x, aborting.\n", status);		err = -EINVAL;		goto err_free_aux;	}	err = mthca_map_eq_icm(mdev, init_hca->eqc_base);	if (err) {		mthca_err(mdev, "Failed to map EQ context memory, aborting.\n");		goto err_unmap_aux;	}	mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base,							 MTHCA_MTT_SEG_SIZE,							 mdev->limits.num_mtt_segs,							 mdev->limits.reserved_mtts, 1);	if (!mdev->mr_table.mtt_table) {		mthca_err(mdev, "Failed to map MTT context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_eq;	}	mdev->mr_table.mpt_table = mthca_alloc_icm_table(mdev, init_hca->mpt_base,							 dev_lim->mpt_entry_sz,							 mdev->limits.num_mpts,							 mdev->limits.reserved_mrws, 1);	if (!mdev->mr_table.mpt_table) {		mthca_err(mdev, "Failed to map MPT context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_mtt;	}	mdev->qp_table.qp_table = mthca_alloc_icm_table(mdev, init_hca->qpc_base,							dev_lim->qpc_entry_sz,							mdev->limits.num_qps,							mdev->limits.reserved_qps, 0);	if (!mdev->qp_table.qp_table) {		mthca_err(mdev, "Failed to map QP context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_mpt;	}	mdev->qp_table.eqp_table = mthca_alloc_icm_table(mdev, init_hca->eqpc_base,							 dev_lim->eqpc_entry_sz,							 mdev->limits.num_qps,							 mdev->limits.reserved_qps, 0);	if (!mdev->qp_table.eqp_table) {		mthca_err(mdev, "Failed to map EQP context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_qp;	}	mdev->qp_table.rdb_table = mthca_alloc_icm_table(mdev, init_hca->rdb_base,							 MTHCA_RDB_ENTRY_SIZE,							 mdev->limits.num_qps <<							 mdev->qp_table.rdb_shift,							 0, 0);	if (!mdev->qp_table.rdb_table) {		mthca_err(mdev, "Failed to map RDB context memory, aborting\n");		err = -ENOMEM;		goto err_unmap_eqp;	}       mdev->cq_table.table = mthca_alloc_icm_table(mdev, init_hca->cqc_base,						     dev_lim->cqc_entry_sz,						     mdev->limits.num_cqs,						     mdev->limits.reserved_cqs, 0);	if (!mdev->cq_table.table) {		mthca_err(mdev, "Failed to map CQ context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_rdb;	}	/*	 * It's not strictly required, but for simplicity just map the	 * whole multicast group table now.  The table isn't very big	 * and it's a lot easier than trying to track ref counts.	 */	mdev->mcg_table.table = mthca_alloc_icm_table(mdev, init_hca->mc_base,						      MTHCA_MGM_ENTRY_SIZE,						      mdev->limits.num_mgms +						      mdev->limits.num_amgms,						      mdev->limits.num_mgms +						      mdev->limits.num_amgms,						      0);	if (!mdev->mcg_table.table) {		mthca_err(mdev, "Failed to map MCG context memory, aborting.\n");		err = -ENOMEM;		goto err_unmap_cq;	}	return 0;err_unmap_cq:	mthca_free_icm_table(mdev, mdev->cq_table.table);err_unmap_rdb:	mthca_free_icm_table(mdev, mdev->qp_table.rdb_table);err_unmap_eqp:	mthca_free_icm_table(mdev, mdev->qp_table.eqp_table);err_unmap_qp:	mthca_free_icm_table(mdev, mdev->qp_table.qp_table);err_unmap_mpt:	mthca_free_icm_table(mdev, mdev->mr_table.mpt_table);err_unmap_mtt:	mthca_free_icm_table(mdev, mdev->mr_table.mtt_table);err_unmap_eq:	mthca_unmap_eq_icm(mdev);err_unmap_aux:	mthca_UNMAP_ICM_AUX(mdev, &status);err_free_aux:	mthca_free_icm(mdev, mdev->fw.arbel.aux_icm);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ec34a922d243c3401a694450734e9effb2bafbfe/mthca_main.c/buggy/drivers/infiniband/hw/mthca/mthca_main.c