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)
commitfbefc5e7e63228d56963eeb0db10209ea0fafe9d
treeac7352b6a72cbc78768fd16294c330a57249bd19
parent185af4d6668e4805d18d1bdf21dfec89d680fee3
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