From: Jörn Engel Date: Sat, 20 Oct 2007 21:14:42 +0000 (+0200) Subject: [RSLIB] BUG() when passing illegal parameters to decode_rs8() or decode_rs16() X-Git-Tag: v2.6.24-rc1~32^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dd7fdb163645f453f5ae55686511b6fcc2314cd;p=linux-2.6 [RSLIB] BUG() when passing illegal parameters to decode_rs8() or decode_rs16() Returning -ERANGE should never happen. Signed-off-by: Jörn Engel Signed-off-by: David Woodhouse --- diff --git a/lib/reed_solomon/decode_rs.c b/lib/reed_solomon/decode_rs.c index a58df56f09..65bc718f0d 100644 --- a/lib/reed_solomon/decode_rs.c +++ b/lib/reed_solomon/decode_rs.c @@ -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); /* Does the caller provide the syndrome ? */ if (s != NULL)