]> git.baikalelectronics.ru Git - kernel.git/commit
MPILIB: Fix comparison of negative MPIs
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 14 Jan 2015 16:10:12 +0000 (16:10 +0000)
committerDavid Howells <dhowells@redhat.com>
Wed, 14 Jan 2015 16:10:12 +0000 (16:10 +0000)
commit2c6e855d602ed1c41129175ad7b321b80519403c
treebaaca0718341de9349805593023944b62336122a
parentc225156c1d035c7b390a574747454d1f6b6092d8
MPILIB: Fix comparison of negative MPIs

If u and v both represent negative integers and their limb counts
happen to differ, mpi_cmp will always return a positive value - this
is obviously bogus. u is smaller than v if and only if it is larger in
absolute value.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
lib/mpi/mpi-cmp.c