提交 3fd1bb9b 编写于 作者: J Jean Delvare 提交者: Linus Torvalds

[PATCH] hwmon: Off-by-one error in fscpos driver

Coverity uncovered an off-by-one error in the fscpos driver, in function
set_temp_reset(). Writing to the temp3_reset sysfs file will lead to an
array overrun, in turn causing an I2C write to a random register of the
FSC Poseidon chip. Additionally, writing to temp1_reset and temp2_reset
will not work as expected. The fix is straightforward.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 566ecb9b
......@@ -167,7 +167,7 @@ static ssize_t set_temp_reset(struct i2c_client *client, struct fscpos_data
"experience to the module author.\n");
/* Supported value: 2 (clears the status) */
fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr], 2);
fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr - 1], 2);
return count;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册