]> git.baikalelectronics.ru Git - kernel.git/commit
rslib: Fix decoding of shortened codes
authorFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Thu, 20 Jun 2019 14:10:34 +0000 (17:10 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 26 Jun 2019 12:55:45 +0000 (14:55 +0200)
commit546699ccc1fc8914f43c2a4ae4b88f3b3ff5b260
treea0124f4c755eccdab837d6edbb758b2eed1b6ebe
parentb7cb59a1b9c9ca3795fd94368ad5da45d94f3246
rslib: Fix decoding of shortened codes

The decoding of shortenend codes is broken. It only works as expected if
there are no erasures.

When decoding with erasures, Lambda (the error and erasure locator
polynomial) is initialized from the given erasure positions. The pad
parameter is not accounted for by the initialisation code, and hence
Lambda is initialized from incorrect erasure positions.

The fix is to adjust the erasure positions by the supplied pad.

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-3-ferdinand.blomqvist@gmail.com
lib/reed_solomon/decode_rs.c