mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
rslib: decode_rs: Fix length parameter check
The length of the data load must be at least one. Or in other words, there must be room for at least 1 data and nroots parity symbols after shortening the RS code. Signed-off-by: Ferdinand Blomqvist <ferdinand.blomqvist@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190620141039.9874-4-ferdinand.blomqvist@gmail.com
This commit is contained in:
parent
2034a42d17
commit
a343536f8f
@ -39,7 +39,7 @@
|
||||
|
||||
/* Check length parameter for validity */
|
||||
pad = nn - nroots - len;
|
||||
BUG_ON(pad < 0 || pad >= nn);
|
||||
BUG_ON(pad < 0 || pad >= nn - nroots);
|
||||
|
||||
/* Does the caller provide the syndrome ? */
|
||||
if (s != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user