Check error return from reading integer part of temperature.
There's a very remote, but possible, chance that the integer part read will fail, but the fraction read succeeds, at which point the reported temperature is invalid. Reported by: Matthew Rezny MFC after: 3 weeks
This commit is contained in:
parent
62141a34e7
commit
6ab4d70393
@ -340,6 +340,10 @@ max6690_sensor_read(struct max6690_sensor *sens)
|
||||
}
|
||||
|
||||
err = max6690_read(sc->sc_dev, sc->sc_addr, reg_int, &integer);
|
||||
|
||||
if (err < 0)
|
||||
return (-1);
|
||||
|
||||
err = max6690_read(sc->sc_dev, sc->sc_addr, reg_ext, &fraction);
|
||||
|
||||
if (err < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user