media: i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 30 Jan 2018 00:32:01 +0000 (19:32 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 23 Feb 2018 08:03:32 +0000 (03:03 -0500)
commit36e49ffb978ef7284ae235b915a7bd6713aa20de
treef3d2abd743f5a868dbb3336d58c914e8fe15eaa3
parentb1f5d0ae930d92bfddb74e99324542456083141a
media: i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval

Cast fi->interval.numerator to u64 in order to avoid a potential integer
overflow. This variable is being used in a context that expects an
expression of type u64.

Addresses-Coverity-ID: 1324146 ("Unintentional integer overflow")
[Sakari Ailus: use do_div() to make this work on 32-bit systems]

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/ov9650.c