diff options
| author | Stanislaw Gruszka <[email protected]> | 2019-03-08 00:28:18 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-03-08 02:32:00 +0000 |
| commit | cdc94a37493135e355dfc0b0e086d84e3eadb50d (patch) | |
| tree | 6ef3fffed75206a1b44d0038d55d0bad914fe497 /lib/assoc_array.c | |
| parent | include/linux/bitops.h: set_mask_bits() to return old value (diff) | |
| download | kernel-cdc94a37493135e355dfc0b0e086d84e3eadb50d.tar.gz kernel-cdc94a37493135e355dfc0b0e086d84e3eadb50d.zip | |
lib/div64.c: off by one in shift
fls counts bits starting from 1 to 32 (returns 0 for zero argument). If
we add 1 we shift right one bit more and loose precision from divisor,
what cause function incorect results with some numbers.
Corrected code was tested in user-space, see bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=202391
Link: http://lkml.kernel.org/r/[email protected]
Fixes: 658716d19f8f ("div64_u64(): improve precision on 32bit platforms")
Signed-off-by: Stanislaw Gruszka <[email protected]>
Reported-by: Siarhei Volkau <[email protected]>
Tested-by: Siarhei Volkau <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/assoc_array.c')
0 files changed, 0 insertions, 0 deletions
