new_adapter = kmalloc(sizeof(struct i2c_adapter), GFP_KERNEL); 
new_adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); 
iop3xx_i2c_probe(struct device *dev){	struct platform_device *pdev = to_platform_device(dev);	struct resource *res;	int ret;	struct i2c_adapter *new_adapter;	struct i2c_algo_iop3xx_data *adapter_data;	new_adapter = kmalloc(sizeof(struct i2c_adapter), GFP_KERNEL);	if (!new_adapter) {		ret = -ENOMEM;		goto out;	}	memset((void*)new_adapter, 0, sizeof(*new_adapter));	adapter_data = kmalloc(sizeof(struct i2c_algo_iop3xx_data), GFP_KERNEL);	if (!adapter_data) {		ret = -ENOMEM;		goto free_adapter;	}	memset((void*)adapter_data, 0, sizeof(*adapter_data));	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);	if (!res) {		ret = -ENODEV;		goto free_both;	}	if (!request_mem_region(res->start, IOP3XX_I2C_IO_SIZE, pdev->name)) {		ret = -EBUSY;		goto free_both;	}	/* set the adapter enumeration # */	adapter_data->id = i2c_id++;	adapter_data->ioaddr = (u32)ioremap(res->start, IOP3XX_I2C_IO_SIZE);	if (!adapter_data->ioaddr) {		ret = -ENOMEM;		goto release_region;	}	res = request_irq(platform_get_irq(pdev, 0), iop3xx_i2c_irq_handler, 0, 				pdev->name, adapter_data);	if (res) {		ret = -EIO;		goto unmap;	}	memcpy(new_adapter->name, pdev->name, strlen(pdev->name));	new_adapter->id = I2C_HW_IOP3XX;	new_adapter->owner = THIS_MODULE;	new_adapter->dev.parent = &pdev->dev;	/*	 * Default values...should these come in from board code?	 */	new_adapter->timeout = 100;		new_adapter->retries = 3;	new_adapter->algo = &iop3xx_i2c_algo;	init_waitqueue_head(&adapter_data->waitq);	spin_lock_init(&adapter_data->lock);	iop3xx_i2c_reset(adapter_data);	iop3xx_i2c_set_slave_addr(adapter_data);	iop3xx_i2c_enable(adapter_data);	dev_set_drvdata(&pdev->dev, new_adapter);	new_adapter->algo_data = adapter_data;	i2c_add_adapter(new_adapter);	return 0;unmap:	iounmap((void __iomem*)adapter_data->ioaddr);release_region:	release_mem_region(res->start, IOP3XX_I2C_IO_SIZE);free_both:	kfree(adapter_data);free_adapter:	kfree(new_adapter);out:	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5263ebb51eb098b01caf229498c954999117e4a7/i2c-iop3xx.c/buggy/drivers/i2c/busses/i2c-iop3xx.c