Skip to contentSkip to conversation

I2C: Fix race condition in it87 driver

PATCH New Jean Delvare 2 participants 2 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 I2C: Fix race condition in it87 driver

Hi Greg,

I noticed a race condition in the it87, affecting the IT8712F chip only. The VRM value is currently initialized *after* creating the vrm and vid sysfs files. This leaves a theorical room for reading from these files and get an invalid value. It's not critical, but let's still fix it.

Please apply, thanks.

drivers/i2c/chips/it87.c renamed from drivers/i2c/chips/it87.c.orig +1 -1
@@ -889,9 +889,9 @@
 	}
 
 	if (data->type = it8712) {
+		data->vrm = i2c_which_vrm();
 		device_create_file_vrm(new_client);
 		device_create_file_vid(new_client);
-		data->vrm = i2c_which_vrm();
 	}
 
 	return 0;
Signature · 1 line
Jean Delvare
Applied
#1 lore raw

PATCH 1/1 I2C: Fix race condition in it87 driver

Quoted 10 lines · Jean Delvare

Hi Greg,

I noticed a race condition in the it87, affecting the IT8712F chip only. The VRM value is currently initialized *after* creating the vrm and vid sysfs files. This leaves a theorical room for reading from these files and get an invalid value. It's not critical, but let's still fix it.

Please apply, thanks.

Applied, thanks.

greg k-h