summaryrefslogtreecommitdiffstats
path: root/lib/mpi
diff options
context:
space:
mode:
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>2012-01-26 18:13:20 +0100
committerJames Morris <jmorris@namei.org>2012-02-01 14:23:39 +0100
commita6d68ecc56ed182644c81ef6917ce1f5404db7dd (patch)
treec2141a497e88fa2d596833f2a27c87f5b995cbc6 /lib/mpi
parentlib/mpi: check for possible zero length (diff)
downloadlinux-a6d68ecc56ed182644c81ef6917ce1f5404db7dd.tar.xz
linux-a6d68ecc56ed182644c81ef6917ce1f5404db7dd.zip
lib/mpi: added comment on divide by 0 case
Comment explains that existing clients do not call this function with dsize == 0, which means that 1/0 should not happen. 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>
Diffstat (limited to 'lib/mpi')
-rw-r--r--lib/mpi/mpih-div.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mpi/mpih-div.c b/lib/mpi/mpih-div.c
index 87ede162dfab..cde1aaec18da 100644
--- a/lib/mpi/mpih-div.c
+++ b/lib/mpi/mpih-div.c
@@ -217,6 +217,10 @@ mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs,
case 0:
/* We are asked to divide by zero, so go ahead and do it! (To make
the compiler not remove this statement, return the value.) */
+ /*
+ * existing clients of this function have been modified
+ * not to call it with dsize == 0, so this should not happen
+ */
return 1 / dsize;
case 1: