diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-10-25 12:38:20 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-10-25 12:38:20 +0200 |
commit | 10d15322ed26652263a579bcb59dfd49ab8a30de (patch) | |
tree | b1497de1b8ffd34b991cdf6e21de1c7a0a65f1de /lib/string_helpers.c | |
parent | 0316d30ea3e66379cd30ed70a114bc282159bb4c (diff) | |
parent | e5a9f8d04660da7ef3a98260aa74c3976f9cb4cd (diff) | |
download | lwn-10d15322ed26652263a579bcb59dfd49ab8a30de.tar.gz lwn-10d15322ed26652263a579bcb59dfd49ab8a30de.zip |
Merge remote-tracking branch 'mac80211-next/master' into next
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++; |