if (!(s4882_algo = kmalloc(5 * sizeof(struct i2c_algorithm), 
if (!(s4882_algo = kzalloc(5 * sizeof(struct i2c_algorithm), 
static int __init amd756_s4882_init(void){	int i, error;	union i2c_smbus_data ioconfig;	/* Unregister physical bus */	error = i2c_del_adapter(&amd756_smbus);	if (error) {		if (error == -EINVAL)			error = -ENODEV;		else			dev_err(&amd756_smbus.dev, "Physical bus removal "				"failed\n");		goto ERROR0;	}	printk(KERN_INFO "Enabling SMBus multiplexing for Tyan S4882\n");	init_MUTEX(&amd756_lock);	/* Define the 5 virtual adapters and algorithms structures */	if (!(s4882_adapter = kmalloc(5 * sizeof(struct i2c_adapter),				      GFP_KERNEL))) {		error = -ENOMEM;		goto ERROR1;	}	if (!(s4882_algo = kmalloc(5 * sizeof(struct i2c_algorithm),				   GFP_KERNEL))) {		error = -ENOMEM;		goto ERROR2;	}	/* Fill in the new structures */	s4882_algo[0] = *(amd756_smbus.algo);	s4882_algo[0].smbus_xfer = amd756_access_virt0;	s4882_adapter[0] = amd756_smbus;	s4882_adapter[0].algo = s4882_algo;	for (i = 1; i < 5; i++) {		s4882_algo[i] = *(amd756_smbus.algo);		s4882_adapter[i] = amd756_smbus;		sprintf(s4882_adapter[i].name,			"SMBus 8111 adapter (CPU%d)", i-1);		s4882_adapter[i].algo = s4882_algo+i;	}	s4882_algo[1].smbus_xfer = amd756_access_virt1;	s4882_algo[2].smbus_xfer = amd756_access_virt2;	s4882_algo[3].smbus_xfer = amd756_access_virt3;	s4882_algo[4].smbus_xfer = amd756_access_virt4;	/* Configure the PCA9556 multiplexer */	ioconfig.byte = 0x00; /* All I/O to output mode */	error = amd756_smbus.algo->smbus_xfer(&amd756_smbus, 0x18, 0,					      I2C_SMBUS_WRITE, 0x03,					      I2C_SMBUS_BYTE_DATA, &ioconfig);	if (error) {		dev_err(&amd756_smbus.dev, "PCA9556 configuration failed\n");		error = -EIO;		goto ERROR3;	}	/* Register virtual adapters */	for (i = 0; i < 5; i++) {		error = i2c_add_adapter(s4882_adapter+i);		if (error) {			dev_err(&amd756_smbus.dev,			       "Virtual adapter %d registration "			       "failed, module not inserted\n", i);			for (i--; i >= 0; i--)				i2c_del_adapter(s4882_adapter+i);			goto ERROR3;		}	}	return 0;ERROR3:	kfree(s4882_algo);	s4882_algo = NULL;ERROR2:	kfree(s4882_adapter);	s4882_adapter = NULL;ERROR1:	i2c_del_adapter(&amd756_smbus);ERROR0:	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/deb875c7ff2ef417a2daff41ee4b357098b7ab10/i2c-amd756-s4882.c/buggy/drivers/i2c/busses/i2c-amd756-s4882.c