From owner-svn-src-all@FreeBSD.ORG Sun Oct 12 23:48:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67E491A5; Sun, 12 Oct 2014 23:48:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5410CA78; Sun, 12 Oct 2014 23:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CNmuuR057587; Sun, 12 Oct 2014 23:48:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CNmuuJ057586; Sun, 12 Oct 2014 23:48:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201410122348.s9CNmuuJ057586@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 12 Oct 2014 23:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273016 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 23:48:56 -0000 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)