aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/mpt2sas/mpi/mpi2_raid.h
diff options
context:
space:
mode:
authorJean Delvare <[email protected]>2012-12-19 22:17:00 +0100
committerJean Delvare <[email protected]>2012-12-19 22:17:00 +0100
commit45633fb370fdd16608756d587245459bf8983a26 (patch)
treec5f840fea63b034ef56f1bd15179ddae20790f25 /drivers/scsi/mpt2sas/mpi/mpi2_raid.h
parent8f3c7c547d47bcfcf9ca2ed30b79733ce1e7ad3a (diff)
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 <[email protected]> Cc: Peter Huewe <[email protected]> Reviewed-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions