[PATCH] BUG() when passing illegal parameters to decode_rs8() or decode_rs16()
Thomas Gleixner
tglx at linutronix.de
Sun Oct 21 04:06:53 EDT 2007
On Sat, 20 Oct 2007, Jörn Engel wrote:
> Returning -ERANGE should never happen.
>
> --- linux-2.6.22cow/lib/reed_solomon/decode_rs.c~rs_ERANGE 2006-10-13 15:58:51.000000000 +0200
> +++ linux-2.6.22cow/lib/reed_solomon/decode_rs.c 2007-10-20 13:07:57.000000000 +0200
> @@ -39,8 +39,7 @@
>
> /* Check length parameter for validity */
> pad = nn - nroots - len;
> - if (pad < 0 || pad >= nn)
> - return -ERANGE;
> + BUG_ON(pad < 0 || pad >= nn);
No. It should never happen, but escalating an error which the kernel
can survive under a lot of circumstances to a fatal death error is
wrong.
Thanks,
tglx
More information about the linux-mtd
mailing list