From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Cameron Date: Sun, 03 Jun 2018 15:12:34 +0000 Subject: Re: [PATCH][next] iio: tsl2x7x/tsl2772: avoid potential division by zero Message-Id: <20180603161234.008ac6c5@archlinux> List-Id: References: <20180530181936.17902-1-colin.king@canonical.com> <20180531092801.bsmqujkfnge3xhpo@0dcddc0a723b> In-Reply-To: <20180531092801.bsmqujkfnge3xhpo@0dcddc0a723b> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Brian Masney Cc: Colin King , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org On Thu, 31 May 2018 05:28:01 -0400 Brian Masney wrote: > On Wed, May 30, 2018 at 07:19:36PM +0100, Colin King wrote: > > From: Colin Ian King > > > > It may be possible for tsl2772_get_lux to return a zero lux value > > and hence a division by zero can occur when lux_val is zero. Check > > for this case and return -ERANGE to avoid the division by zero. > > > > Detected by CoverityScan, CID#1469484 ("Division or modulo by zero") > > > > Signed-off-by: Colin Ian King > > Acked-by: Brian Masney Applied to the fixes-togreg branch of iio.git. As there was nothing in that branch that is going upstream until after the merge window closes, I moved it forward to match staging/staging-next. Jonathan