kfree(new_client); 
kfree(data); 
static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct adm1031_data *data;	int err = 0;	const char *name = "";	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))		goto exit;	if (!(data = kmalloc(sizeof(struct adm1031_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	memset(data, 0, sizeof(struct adm1031_data));	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &adm1031_driver;	new_client->flags = 0;	if (kind < 0) {		int id, co;		id = i2c_smbus_read_byte_data(new_client, 0x3d);		co = i2c_smbus_read_byte_data(new_client, 0x3e);		if (!((id == 0x31 || id == 0x30) && co == 0x41))			goto exit_free;		kind = (id == 0x30) ? adm1030 : adm1031;	}	if (kind <= 0)		kind = adm1031;	/* Given the detected chip type, set the chip name and the	 * auto fan control helper table. */	if (kind == adm1030) {		name = "adm1030";		data->chan_select_table = &auto_channel_select_table_adm1030;	} else if (kind == adm1031) {		name = "adm1031";		data->chan_select_table = &auto_channel_select_table_adm1031;	}	data->chip_type = kind;	strlcpy(new_client->name, name, I2C_NAME_SIZE);	data->valid = 0;	init_MUTEX(&data->update_lock);	/* Tell the I2C layer a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_free;	/* Initialize the ADM1031 chip */	adm1031_init_client(new_client);	/* Register sysfs hooks */	device_create_file(&new_client->dev, &dev_attr_fan1_input);	device_create_file(&new_client->dev, &dev_attr_fan1_div);	device_create_file(&new_client->dev, &dev_attr_fan1_min);	device_create_file(&new_client->dev, &dev_attr_pwm1);	device_create_file(&new_client->dev, &dev_attr_auto_fan1_channel);	device_create_file(&new_client->dev, &dev_attr_temp1_input);	device_create_file(&new_client->dev, &dev_attr_temp1_min);	device_create_file(&new_client->dev, &dev_attr_temp1_max);	device_create_file(&new_client->dev, &dev_attr_temp1_crit);	device_create_file(&new_client->dev, &dev_attr_temp2_input);	device_create_file(&new_client->dev, &dev_attr_temp2_min);	device_create_file(&new_client->dev, &dev_attr_temp2_max);	device_create_file(&new_client->dev, &dev_attr_temp2_crit);	device_create_file(&new_client->dev, &dev_attr_auto_temp1_off);	device_create_file(&new_client->dev, &dev_attr_auto_temp1_min);	device_create_file(&new_client->dev, &dev_attr_auto_temp1_max);	device_create_file(&new_client->dev, &dev_attr_auto_temp2_off);	device_create_file(&new_client->dev, &dev_attr_auto_temp2_min);	device_create_file(&new_client->dev, &dev_attr_auto_temp2_max);	device_create_file(&new_client->dev, &dev_attr_auto_fan1_min_pwm);	device_create_file(&new_client->dev, &dev_attr_alarms);	if (kind == adm1031) {		device_create_file(&new_client->dev, &dev_attr_fan2_input);		device_create_file(&new_client->dev, &dev_attr_fan2_div);		device_create_file(&new_client->dev, &dev_attr_fan2_min);		device_create_file(&new_client->dev, &dev_attr_pwm2);		device_create_file(&new_client->dev,				   &dev_attr_auto_fan2_channel);		device_create_file(&new_client->dev, &dev_attr_temp3_input);		device_create_file(&new_client->dev, &dev_attr_temp3_min);		device_create_file(&new_client->dev, &dev_attr_temp3_max);		device_create_file(&new_client->dev, &dev_attr_temp3_crit);		device_create_file(&new_client->dev, &dev_attr_auto_temp3_off);		device_create_file(&new_client->dev, &dev_attr_auto_temp3_min);		device_create_file(&new_client->dev, &dev_attr_auto_temp3_max);		device_create_file(&new_client->dev, &dev_attr_auto_fan2_min_pwm);	}	return 0;exit_free:	kfree(new_client);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1f57ff89fee47a317e9e8ca63bf0f139802cc116/adm1031.c/clean/drivers/hwmon/adm1031.c