Jean Delvare 45633fb370 hwmon: (w83627ehf) Get rid of smatch warnings
The smatch static code analyzer complains:

drivers/hwmon/w83627ehf.c:911 w83627ehf_update_device() error: buffer overflow 'W83627EHF_REG_TEMP_OFFSET' 3 <= 8
drivers/hwmon/w83627ehf.c:909 w83627ehf_update_device() error: buffer overflow 'data->temp_offset' 3 <= 8
drivers/hwmon/w83627ehf.c:2672 w83627ehf_resume() error: buffer overflow 'W83627EHF_REG_TEMP_OFFSET' 3 <= 8
drivers/hwmon/w83627ehf.c:2673 w83627ehf_resume() error: buffer overflow 'data->temp_offset' 3 <= 8

A deeper analysis of the code shows that these are false positives, as
only the lower 3 bits of data->have_temp_offset can be set so the
write is never attempted with i >= 3. However this shows that the code
isn't very robust and future changes could easily introduce a buffer
overflow. So let's add a safety check to prevent that and make smatch
happy.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Peter Huewe <PeterHuewe@gmx.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2012-12-19 22:17:00 +01:00
..
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-05 21:54:40 +01:00
2012-12-11 13:13:55 -08:00
2012-12-11 13:13:55 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:49:40 -08:00
2012-12-11 13:13:55 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-12-13 10:59:11 -08:00
2012-11-28 11:50:34 -08:00
2012-01-05 08:19:35 -08:00
2012-11-28 11:50:34 -08:00
2012-12-13 10:59:11 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-10-10 15:25:56 +02:00
2012-10-10 15:25:56 +02:00
2012-11-28 11:50:34 -08:00
2012-09-23 21:08:36 -07:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00