Commit 3be6bd69 authored by Anton Vasilyev's avatar Anton Vasilyev Committed by Guenter Roeck
Browse files

hwmon: (stts751) buffer overrun on wrong chip configuration

If stts751 hw by some reason reports conversion rate bigger then 9:
        ret = i2c_smbus_read_byte_data(priv->client, STTS751_REG_RATE);
then dereferencing stts751_intervals[priv->interval] leads to buffer
overrun.

The patch adds sanity check for value stored on chip.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 7f07ec0f

 ("hwmon: new driver for ST stts751 thermal sensor")
Signed-off-by: default avatarAnton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 7576750f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment