svn commit: r273016 - head/sys/dev/iicbus
Justin Hibbits
jhibbits at FreeBSD.org
Sun Oct 12 23:48:56 UTC 2014
Author: jhibbits
Date: Sun Oct 12 23:48:55 2014
New Revision: 273016
URL: https://svnweb.freebsd.org/changeset/base/273016
Log:
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
Modified:
head/sys/dev/iicbus/max6690.c
Modified: head/sys/dev/iicbus/max6690.c
==============================================================================
--- head/sys/dev/iicbus/max6690.c Sun Oct 12 23:46:24 2014 (r273015)
+++ head/sys/dev/iicbus/max6690.c Sun Oct 12 23:48:55 2014 (r273016)
@@ -340,6 +340,10 @@ max6690_sensor_read(struct max6690_senso
}
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)
More information about the svn-src-all
mailing list