diff options
author | Bernd Porr <mail@berndporr.me.uk> | 2019-11-18 23:07:59 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-22 11:32:54 +0100 |
commit | 5618332e5b955b4bff06d0b88146b971c8dd7b32 (patch) | |
tree | a66ea2fde6930c4e94b5840114effcb8a78a64de /ipc/sem.c | |
parent | 1637a947e684dfdaae9e91b902297f65517259c9 (diff) | |
download | linux-5618332e5b955b4bff06d0b88146b971c8dd7b32.tar.bz2 |
staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error
The userspace comedilib function 'get_cmd_generic_timed' fills
the cmd structure with an informed guess and then calls the
function 'usbduxfast_ai_cmdtest' in this driver repeatedly while
'usbduxfast_ai_cmdtest' is modifying the cmd struct until it
no longer changes. However, because of rounding errors this never
converged because 'steps = (cmd->convert_arg * 30) / 1000' and then
back to 'cmd->convert_arg = (steps * 1000) / 30' won't be the same
because of rounding errors. 'Steps' should only be converted back to
the 'convert_arg' if 'steps' has actually been modified. In addition
the case of steps being 0 wasn't checked which is also now done.
Signed-off-by: Bernd Porr <mail@berndporr.me.uk>
Cc: <stable@vger.kernel.org> # 4.4+
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20191118230759.1727-1-mail@berndporr.me.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc/sem.c')
0 files changed, 0 insertions, 0 deletions