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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)