Skip to content

Commit

Permalink
[PATCH] hwmon: Off-by-one error in fscpos driver
Browse files Browse the repository at this point in the history
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: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed Aug 26, 2005
1 parent 566ecb9 commit 3fd1bb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/fscpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3fd1bb9

Please sign in to comment.