summaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/mpi-mod.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2024-08-10 14:20:57 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2024-08-17 13:55:50 +0800
commit8e3a67f2de87ee94ac11ea69beb4edc2993b17a0 (patch)
treef9d05f6e63667776697cf2642098292f7c9d91cf /lib/crypto/mpi/mpi-mod.c
parentfca5cb4dd2b4a9423cb6d112cc71c33899955a1f (diff)
downloadlwn-8e3a67f2de87ee94ac11ea69beb4edc2993b17a0.tar.gz
lwn-8e3a67f2de87ee94ac11ea69beb4edc2993b17a0.zip
crypto: lib/mpi - Add error checks to extension
The remaining functions added by commit a8ea8bdd9df92a0e5db5b43900abb7a288b8a53e did not check for memory allocation errors. Add the checks and change the API to allow errors to be returned. Fixes: a8ea8bdd9df9 ("lib/mpi: Extend the MPI library") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'lib/crypto/mpi/mpi-mod.c')
-rw-r--r--lib/crypto/mpi/mpi-mod.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/crypto/mpi/mpi-mod.c b/lib/crypto/mpi/mpi-mod.c
index 691bbdc52fc6..d5fdaec3d0b6 100644
--- a/lib/crypto/mpi/mpi-mod.c
+++ b/lib/crypto/mpi/mpi-mod.c
@@ -7,7 +7,7 @@
#include "mpi-internal.h"
-void mpi_mod(MPI rem, MPI dividend, MPI divisor)
+int mpi_mod(MPI rem, MPI dividend, MPI divisor)
{
- mpi_fdiv_r(rem, dividend, divisor);
+ return mpi_fdiv_r(rem, dividend, divisor);
}