diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-12-11 00:54:37 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-11 02:41:16 +0100 |
commit | ddbc22e27e672b6b180757ea1d7f8481dbb88128 (patch) | |
tree | dd1c05913129d4fc065054d275fb5b0112745649 /crypto/scatterwalk.c | |
parent | nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races (diff) | |
download | linux-ddbc22e27e672b6b180757ea1d7f8481dbb88128.tar.xz linux-ddbc22e27e672b6b180757ea1d7f8481dbb88128.zip |
fs/hfs/catalog.c: fix comparison bug in hfs_cat_keycmp
Relying on the sign (after casting to int) of the difference of two
quantities for comparison is usually wrong. For example, should a-b
turn out to be 2^31, the return value of cmp(a,b) is -2^31; but that
would also be the return value from cmp(b, a). So a compares less than
b and b compares less than a. One can also easily find three values
a,b,c such that a compares less than b, b compares less than c, but a
does not compare less than c.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'crypto/scatterwalk.c')
0 files changed, 0 insertions, 0 deletions