Commit a343536f authored by Ferdinand Blomqvist's avatar Ferdinand Blomqvist Committed by Thomas Gleixner

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: default avatarFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190620141039.9874-4-ferdinand.blomqvist@gmail.com
parent 2034a42d
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment