Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[RSLIB] BUG() when passing illegal parameters to decode_rs8() or decode_rs16()

Returning -ERANGE should never happen.

Signed-off-by: Jörn Engel <joern@logfs.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

authored by

Jörn Engel and committed by
David Woodhouse
1dd7fdb1 c32b8dcc

+1 -2
+1 -2
lib/reed_solomon/decode_rs.c
··· 39 39 40 40 /* Check length parameter for validity */ 41 41 pad = nn - nroots - len; 42 - if (pad < 0 || pad >= nn) 43 - return -ERANGE; 42 + BUG_ON(pad < 0 || pad >= nn); 44 43 45 44 /* Does the caller provide the syndrome ? */ 46 45 if (s != NULL)