[media] msi001: fix possible integer overflow
authorAntti Palosaari <crope@iki.fi>
Sat, 5 Apr 2014 20:23:41 +0000 (17:23 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 6 Apr 2014 14:07:45 +0000 (11:07 -0300)
commit82932d4cff46627bc1a693893326400aab5f8967
treeddeacf20c462d2e998ac8f38fec7f430d446fc27
parent773bcf8c9ce04c62c513182620efb729c97452fc
[media] msi001: fix possible integer overflow

Coverity CID 1196502: Unintentional integer overflow
(OVERFLOW_BEFORE_WIDEN)

Potentially overflowing expression "(f_rf + f_if + f_if1) * lo_div"
with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit
arithmetic before being used in a context which expects an expression
of type "u64" (64 bits, unsigned). To avoid overflow, cast either
operand to "u64" before performing the multiplication.

Reported-by: <scan-admin@coverity.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/staging/media/msi3101/msi001.c