]> git.baikalelectronics.ru Git - kernel.git/commit
Input: max77693-haptic - fix potential overflow
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 28 Oct 2014 16:27:58 +0000 (09:27 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 31 Oct 2014 16:30:44 +0000 (09:30 -0700)
commit370e2f62ffb5ca960072195dfe70de197c7f8139
treeac7352b6a72cbc78768fd16294c330a57249bd19
parenta40e9346fb2b468b69a12cda69a3c98bc573811b
Input: max77693-haptic - fix potential overflow

Expression haptic->pwm_dev->period * haptic->magnitude is of type
'unsigned int' and may overflow. We need to convert one of the operands
to u64 before multiplying, instead of casting result (potentially
overflown) to u64.

Reported by Coverity: CID 1248753

Acked-by : Jaewon Kim <jaewon02.kim@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/max77693-haptic.c