Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e87c5e35 authored by Dmitry Kasatkin's avatar Dmitry Kasatkin Committed by James Morris
Browse files

lib/mpi: return error code on dividing by zero



Definitely better to return error code than to divide by zero.

Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 3cccd154
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
	ep = exp->d;

	if (!msize)
		msize = 1 / msize;	/* provoke a signal */
		return -EINVAL;

	if (!esize) {
		/* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0