From: Daniel Scheller <d.scheller@xxxxxxx> Fixes smatch error: drivers/media/dvb-frontends/stv0910.c:715 DVBS2_nBCH() error: buffer overflow 'nBCH[FECType]' 2 <= 28 Also, fixes the nBCH array table by adding the DUMMY_PLF element at the top to match the enums (table element order was off by one before). Patch sent upstream aswell. Cc: Ralph Metzler <rjkm@xxxxxxxxxxxxxx> Signed-off-by: Daniel Scheller <d.scheller@xxxxxxx> --- drivers/media/dvb-frontends/stv0910.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 8cb4b30f3a81..a5eac1a3a048 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -680,6 +680,7 @@ static int GetBitErrorRateS(struct stv *state, u32 *BERNumerator, static u32 DVBS2_nBCH(enum DVBS2_ModCod ModCod, enum DVBS2_FECType FECType) { static u32 nBCH[][2] = { + { 0, 0}, /* DUMMY_PLF */ {16200, 3240}, /* QPSK_1_4, */ {21600, 5400}, /* QPSK_1_3, */ {25920, 6480}, /* QPSK_2_5, */ @@ -712,7 +713,7 @@ static u32 DVBS2_nBCH(enum DVBS2_ModCod ModCod, enum DVBS2_FECType FECType) if (ModCod >= DVBS2_QPSK_1_4 && ModCod <= DVBS2_32APSK_9_10 && FECType <= DVBS2_16K) - return nBCH[FECType][ModCod]; + return nBCH[ModCod][FECType]; return 64800; } -- 2.13.0