projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KVM: x86: merge kvm_arch_set_irq with kvm_set_msi_inatomic
[firefly-linux-kernel-4.4.55.git]
/
lib
/
string_helpers.c
diff --git
a/lib/string_helpers.c
b/lib/string_helpers.c
index 54036ce2e2dd0a4ab042c9c19b2d54fa41a34115..5939f63d90cde79fe1e09814765539a7e43a3c28 100644
(file)
--- 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;
}
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++;
remainder = do_div(size, divisor[units]);
remainder *= blk_size;
i++;