summaryrefslogtreecommitdiff
path: root/drivers/usb/class/cdc-acm.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2019-08-12 12:15:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-25 10:53:01 +0200
commit893e2dbcfb77efdcd5025786f30f5fc7e91e8cb6 (patch)
treed18ce69308ac0f661cabd7f31038463e2fe62a70 /drivers/usb/class/cdc-acm.c
parentdbc68075c36b82a0c0b4c34d3d42ffc3f08fd492 (diff)
staging: comedi: dt3000: Fix signed integer overflow 'divider * base'
commit b4d98bc3fc93ec3a58459948a2c0e0c9b501cd88 upstream. In `dt3k_ns_to_timer()` the following lines near the end of the function result in a signed integer overflow: prescale = 15; base = timer_base * (1 << prescale); divider = 65535; *nanosec = divider * base; (`divider`, `base` and `prescale` are type `int`, `timer_base` and `*nanosec` are type `unsigned int`. The value of `timer_base` will be either 50 or 100.) The main reason for the overflow is that the calculation for `base` is completely wrong. It should be: base = timer_base * (prescale + 1); which matches an earlier instance of this calculation in the same function. Reported-by: David Binderman <dcb314@hotmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20190812111517.26803-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
0 files changed, 0 insertions, 0 deletions