 err_out_table: if (dev->hca_type == ARBEL_NATIVE) mthca_table_put(dev, dev->mr_table.mpt_table, key);  err_out_mpt_free: mthca_free(&dev->mr_table.mpt_alloc, mr->ibmr.lkey); kfree(mailbox); return err; 
int mthca_mr_alloc_notrans(struct mthca_dev *dev, u32 pd,			   u32 access, struct mthca_mr *mr){	void *mailbox;	struct mthca_mpt_entry *mpt_entry;	u32 key;	int err;	u8 status;	might_sleep();	mr->order = -1;	key = mthca_alloc(&dev->mr_table.mpt_alloc);	if (key == -1)		return -ENOMEM;	mr->ibmr.rkey = mr->ibmr.lkey = hw_index_to_key(dev, key);	mailbox = kmalloc(sizeof *mpt_entry + MTHCA_CMD_MAILBOX_EXTRA,			  GFP_KERNEL);	if (!mailbox) {		mthca_free(&dev->mr_table.mpt_alloc, mr->ibmr.lkey);		return -ENOMEM;	}	mpt_entry = MAILBOX_ALIGN(mailbox);	mpt_entry->flags = cpu_to_be32(MTHCA_MPT_FLAG_SW_OWNS     |				       MTHCA_MPT_FLAG_MIO         |				       MTHCA_MPT_FLAG_PHYSICAL    |				       MTHCA_MPT_FLAG_REGION      |				       access);	mpt_entry->page_size = 0;	mpt_entry->key       = cpu_to_be32(key);	mpt_entry->pd        = cpu_to_be32(pd);	mpt_entry->start     = 0;	mpt_entry->length    = ~0ULL;	memset(&mpt_entry->lkey, 0,	       sizeof *mpt_entry - offsetof(struct mthca_mpt_entry, lkey));	err = mthca_SW2HW_MPT(dev, mpt_entry,			      key & (dev->limits.num_mpts - 1),			      &status);	if (err)		mthca_warn(dev, "SW2HW_MPT failed (%d)\n", err);	else if (status) {		mthca_warn(dev, "SW2HW_MPT returned status 0x%02x\n",			   status);		err = -EINVAL;	}	kfree(mailbox);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/86562a139182bb19c984347f9625b61f3e6f7815/mthca_mr.c/clean/drivers/infiniband/hw/mthca/mthca_mr.c