]> 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)
commit2edf3f7fe2d6ffb45abd9cb8585e47d9294945d8
treeac7352b6a72cbc78768fd16294c330a57249bd19
parent963e9e428694f08b601e888e25d2a764944e5147
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