kfree(mailbox); 
mthca_free_mailbox(dev, mailbox); 
static int find_mgm(struct mthca_dev *dev,		    u8 *gid, struct mthca_mgm *mgm,		    u16 *hash, int *prev, int *index){	void *mailbox;	u8 *mgid;	int err;	u8 status;	mailbox = kmalloc(16 + MTHCA_CMD_MAILBOX_EXTRA, GFP_KERNEL);	if (!mailbox)		return -ENOMEM;	mgid = MAILBOX_ALIGN(mailbox);	memcpy(mgid, gid, 16);	err = mthca_MGID_HASH(dev, mgid, hash, &status);	if (err)		goto out;	if (status) {		mthca_err(dev, "MGID_HASH returned status %02x\n", status);		err = -EINVAL;		goto out;	}	if (0)		mthca_dbg(dev, "Hash for %04x:%04x:%04x:%04x:"			  "%04x:%04x:%04x:%04x is %04x\n",			  be16_to_cpu(((u16 *) gid)[0]), be16_to_cpu(((u16 *) gid)[1]),			  be16_to_cpu(((u16 *) gid)[2]), be16_to_cpu(((u16 *) gid)[3]),			  be16_to_cpu(((u16 *) gid)[4]), be16_to_cpu(((u16 *) gid)[5]),			  be16_to_cpu(((u16 *) gid)[6]), be16_to_cpu(((u16 *) gid)[7]),			  *hash);	*index = *hash;	*prev  = -1;	do {		err = mthca_READ_MGM(dev, *index, mgm, &status);		if (err)			goto out;		if (status) {			mthca_err(dev, "READ_MGM returned status %02x\n", status);			return -EINVAL;		}		if (!memcmp(mgm->gid, zero_gid, 16)) {			if (*index != *hash) {				mthca_err(dev, "Found zero MGID in AMGM.\n");				err = -EINVAL;			}			goto out;		}		if (!memcmp(mgm->gid, gid, 16))			goto out;		*prev = *index;		*index = be32_to_cpu(mgm->next_gid_index) >> 5;	} while (*index);	*index = -1; out:	kfree(mailbox);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ed878458eeff9754d66f1b0325df6ebbfcdce668/mthca_mcg.c/buggy/drivers/infiniband/hw/mthca/mthca_mcg.c