exit_detach: i2c_detach_client(new_client); 
static int gl520_detect(struct i2c_adapter *adapter, int address, int kind){	struct i2c_client *new_client;	struct gl520_data *data;	int err = 0;	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |				     I2C_FUNC_SMBUS_WORD_DATA))		goto exit;	/* OK. For now, we presume we have a valid client. We now create the	   client structure, even though we cannot fill it completely yet.	   But it allows us to access gl520_{read,write}_value. */	if (!(data = kmalloc(sizeof(struct gl520_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit;	}	memset(data, 0, sizeof(struct gl520_data));	new_client = &data->client;	i2c_set_clientdata(new_client, data);	new_client->addr = address;	new_client->adapter = adapter;	new_client->driver = &gl520_driver;	new_client->flags = 0;	/* Determine the chip type. */	if (kind < 0) {		if ((gl520_read_value(new_client, GL520_REG_CHIP_ID) != 0x20) ||		    ((gl520_read_value(new_client, GL520_REG_REVISION) & 0x7f) != 0x00) ||		    ((gl520_read_value(new_client, GL520_REG_CONF) & 0x80) != 0x00)) {			dev_dbg(&new_client->dev, "Unknown chip type, skipping\n");			goto exit_free;		}	}	/* Fill in the remaining client fields */	strlcpy(new_client->name, "gl520sm", 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 GL520SM chip */	gl520_init_client(new_client);	/* Register sysfs hooks */	device_create_file_vid(new_client, 0);	device_create_file_in(new_client, 0);	device_create_file_in(new_client, 1);	device_create_file_in(new_client, 2);	device_create_file_in(new_client, 3);	if (!data->two_temps)		device_create_file_in(new_client, 4);	device_create_file_fan(new_client, 1);	device_create_file_fan(new_client, 2);	device_create_file_fan_off(new_client, 1);	device_create_file_temp(new_client, 1);	if (data->two_temps)		device_create_file_temp(new_client, 2);	device_create_file_alarms(new_client);	return 0;exit_free:	kfree(data);exit:	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/943b0830cebe4711354945ed3cb44e84152aaca0/gl520sm.c/clean/drivers/hwmon/gl520sm.c