View | Details | Raw Unified | Return to bug 4347 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.11.4/drivers/i2c/chips/eeprom.c.orig (-2 / +4 lines)
Lines 130-136 Link Here
130
130
131
	/* Hide Vaio security settings to regular users (16 first bytes) */
131
	/* Hide Vaio security settings to regular users (16 first bytes) */
132
	if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
132
	if (data->nature == VAIO && off < 16 && !capable(CAP_SYS_ADMIN)) {
133
		int in_row1 = 16 - off;
133
		size_t in_row1 = 16 - off;
134
		in_row1 = min(in_row1, count);
134
		memset(buf, 0, in_row1);
135
		memset(buf, 0, in_row1);
135
		if (count - in_row1 > 0)
136
		if (count - in_row1 > 0)
136
			memcpy(buf + in_row1, &data->data[16], count - in_row1);
137
			memcpy(buf + in_row1, &data->data[16], count - in_row1);
Lines 209-218 Link Here
209
		if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'
210
		if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P'
210
		 && i2c_smbus_read_byte(new_client) == 'C'
211
		 && i2c_smbus_read_byte(new_client) == 'C'
211
		 && i2c_smbus_read_byte(new_client) == 'G'
212
		 && i2c_smbus_read_byte(new_client) == 'G'
212
		 && i2c_smbus_read_byte(new_client) == '-')
213
		 && i2c_smbus_read_byte(new_client) == '-') {
213
			dev_info(&new_client->dev, "Vaio EEPROM detected, "
214
			dev_info(&new_client->dev, "Vaio EEPROM detected, "
214
				"enabling password protection\n");
215
				"enabling password protection\n");
215
			data->nature = VAIO;
216
			data->nature = VAIO;
217
		}
216
	}
218
	}
217
219
218
	/* create the sysfs eeprom file */
220
	/* create the sysfs eeprom file */

Return to bug 4347