[patch] mtg: docg3: potential divide by zero in doc_write_oob()

Robert Jarzmik robert.jarzmik at free.fr
Thu Nov 29 13:46:54 EST 2012


Dan Carpenter <dan.carpenter at oracle.com> writes:

> If we set oobdelta to zero then we will either return -EINVAL or hit
> a divide (modulus) by zero on the next line when we check
> "(ooblen % oobdelta)".  It's better to just return -EINVAL here instead.
>
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> ---
> Static analysis.  I don't know if it's actually possible to hit this
> condition.
I don't know any possibility to reach that condition, nonetheless the patch
makes the code more robust, therefore :

Acked-by: Robert Jarzmik <robert.jarzmik at free.fr>

Cheers.

--
Robert



More information about the linux-mtd mailing list