lkml.org 
[lkml]   [2018]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] iio: tsl2x7x/tsl2772: avoid potential division by zero
On Wed, May 30, 2018 at 07:19:36PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>

Acked-by: Brian Masney <masneyb@onstation.org>

\
 
 \ /
  Last update: 2018-05-31 11:28    [W:0.065 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site