Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <yousaf.kaukab@suse.com>2017-11-15 00:46:23 +0100
committerMian Yousaf Kaukab <yousaf.kaukab@suse.com>2017-11-15 15:39:57 +0100
commit730fc341bdaff57fba2dbbf8830405ab6b634f4a (patch)
treec9fb758972e6ad9bda7cd462288a9a2bdb2115fd
parentc8d683809c29d5557e7ca44f982e83423f90d720 (diff)
lib/mpi: call cond_resched() from mpi_powm() loop (bsc#1066688).
-rw-r--r--lib/mpi/mpi-pow.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/mpi/mpi-pow.c b/lib/mpi/mpi-pow.c
index e24388a863a7..468fb7cd1221 100644
--- a/lib/mpi/mpi-pow.c
+++ b/lib/mpi/mpi-pow.c
@@ -26,6 +26,7 @@
* however I decided to publish this code under the plain GPL.
*/
+#include <linux/sched.h>
#include <linux/string.h>
#include "mpi-internal.h"
#include "longlong.h"
@@ -256,6 +257,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
}
e <<= 1;
c--;
+ cond_resched();
}
i--;