aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-03-30 22:31:21 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-03-30 22:31:21 -0800
commit9d8eaff2367739d3b0c96a6c83343b8ea1456062 (patch)
treed4071eb831f5943e2e29b330f560b298d688eb9a
parentadcca21aa6af4df6d6e366434a5177a1f76d4355 (diff)
downloadhistory-9d8eaff2367739d3b0c96a6c83343b8ea1456062.tar.gz
[PATCH] I2C: Fix race condition in it87 driver
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. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/i2c/chips/it87.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index fbb97e6aec6fbb..bf02ba555a8518 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -889,9 +889,9 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
}
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;