Commit a6d68ecc authored by Dmitry Kasatkin's avatar Dmitry Kasatkin Committed by James Morris

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: 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 4877e056
...@@ -217,6 +217,10 @@ mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs, ...@@ -217,6 +217,10 @@ mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs,
case 0: case 0:
/* We are asked to divide by zero, so go ahead and do it! (To make /* We are asked to divide by zero, so go ahead and do it! (To make
the compiler not remove this statement, return the value.) */ 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; return 1 / dsize;
case 1: case 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment