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:
Justin Hibbits 2014-10-12 23:48:55 +00:00
parent 62141a34e7
commit 6ab4d70393

View File

@ -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)