projects
/
profile
/
common
/
kernel-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cccd15
)
lib/mpi: return error code on dividing by zero
author
Dmitry Kasatkin
<dmitry.kasatkin@intel.com>
Thu, 26 Jan 2012 17:13:21 +0000
(19:13 +0200)
committer
James Morris
<jmorris@namei.org>
Wed, 1 Feb 2012 13:23:14 +0000
(
00:23
+1100)
Definitely better to return error code than to divide by zero.
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Reviewed-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
lib/mpi/mpi-pow.c
patch
|
blob
|
history
diff --git
a/lib/mpi/mpi-pow.c
b/lib/mpi/mpi-pow.c
index
b04a3cf
..
67f3e79
100644
(file)
--- a/
lib/mpi/mpi-pow.c
+++ b/
lib/mpi/mpi-pow.c
@@
-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