diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-09-18 09:24:01 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-09-18 09:24:01 +0200 |
commit | 02386c356af0ce5bbee11ed9b23c312ca60298f0 (patch) | |
tree | 24d6816d783975cbc237af3a53c34f44fda03de2 /lib/string_helpers.c | |
parent | d71b0ad8d30922ccdd0705318237e6890b4ec1b6 (diff) | |
parent | f73e22ab450140830005581c2c7ec389791a1b8d (diff) |
Merge branch 'perf/urgent' into perf/core, to pick up fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/string_helpers.c')
-rw-r--r-- | lib/string_helpers.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 54036ce2e2dd..5939f63d90cd 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -59,7 +59,11 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units, } exp = divisor[units] / (u32)blk_size; - if (size >= exp) { + /* + * size must be strictly greater than exp here to ensure that remainder + * is greater than divisor[units] coming out of the if below. + */ + if (size > exp) { remainder = do_div(size, divisor[units]); remainder *= blk_size; i++; |