OSDN Git Service

rslib: Fix decoding of shortened codes
authorFerdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Thu, 20 Jun 2019 14:10:34 +0000 (17:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:34:48 +0000 (09:34 +0200)
commita7a7839b5537a5a0070d279d2007982c270a4516
tree46b2490512e0d1c46d829f8b9af4c53b5a67d1a7
parent3d2af3adeade7dc9242442159f3cb32bc12f39c1
rslib: Fix decoding of shortened codes

[ Upstream commit 2034a42d1747fc1e1eeef2c6f1789c4d0762cb9c ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/reed_solomon/decode_rs.c