if (ioc->spi_data.pIocPg3) { kfree(ioc->spi_data.pIocPg3); ioc->spi_data.pIocPg3 = NULL; } 
kfree(ioc->spi_data.pIocPg3); ioc->spi_data.pIocPg3 = NULL; 
mpt_read_ioc_pg_3(MPT_ADAPTER *ioc){	IOCPage3_t		*pIoc3;	u8			*mem;	CONFIGPARMS		 cfg;	ConfigPageHeader_t	 header;	dma_addr_t		 ioc3_dma;	int			 iocpage3sz = 0;	/* Free the old page	 */	if (ioc->spi_data.pIocPg3) {		kfree(ioc->spi_data.pIocPg3);		ioc->spi_data.pIocPg3 = NULL;	}	/* There is at least one physical disk.	 * Read and save IOC Page 3	 */	header.PageVersion = 0;	header.PageLength = 0;	header.PageNumber = 3;	header.PageType = MPI_CONFIG_PAGETYPE_IOC;	cfg.hdr = &header;	cfg.physAddr = -1;	cfg.pageAddr = 0;	cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;	cfg.dir = 0;	cfg.timeout = 0;	if (mpt_config(ioc, &cfg) != 0)		return 0;	if (header.PageLength == 0)		return 0;	/* Read Header good, alloc memory	 */	iocpage3sz = header.PageLength * 4;	pIoc3 = pci_alloc_consistent(ioc->pcidev, iocpage3sz, &ioc3_dma);	if (!pIoc3)		return 0;	/* Read the Page and save the data	 * into malloc'd memory.	 */	cfg.physAddr = ioc3_dma;	cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;	if (mpt_config(ioc, &cfg) == 0) {		mem = kmalloc(iocpage3sz, GFP_ATOMIC);		if (mem) {			memcpy(mem, (u8 *)pIoc3, iocpage3sz);			ioc->spi_data.pIocPg3 = (IOCPage3_t *) mem;		}	}	pci_free_consistent(ioc->pcidev, iocpage3sz, pIoc3, ioc3_dma);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d485eb830576eef911727b1347402e9a708998a2/mptbase.c/buggy/drivers/message/fusion/mptbase.c