]> git.baikalelectronics.ru Git - kernel.git/commit
[media] v4l2-dv-timings: fix overflow in gtf timings calculation
authorPrashant Laddha <prladdha@cisco.com>
Tue, 5 May 2015 13:16:27 +0000 (10:16 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 18 May 2015 19:27:29 +0000 (16:27 -0300)
commit4837acd5fb02fd1e9a3d7b322d929af6c9d3a727
tree3c2222d564c150a359f951a5f21ebc7e477a4f6e
parentcb394ba7f41dc0aba894c1cd94d9cd5ef62d1600
[media] v4l2-dv-timings: fix overflow in gtf timings calculation

The intermediate calculation in the expression for hblank can exceed
32 bit signed range. This overflow can lead to negative values for
hblank. Typecasting intermediate variable to higher precision.

Cc: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
[hans.verkuil@cisco.com: made the denominator u32, since that's what div_u64 expects]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/v4l2-dv-timings.c