From: Michael Krufky Date: Mon, 21 May 2012 15:28:14 +0000 (-0300) Subject: [media] lg2160: fix off-by-one error in lg216x_write_regs X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bffaecc75cc6cbbf1e46571256d7b137df61bff6;p=linux-beck.git [media] lg2160: fix off-by-one error in lg216x_write_regs Fix an off-by-one error in lg216x_write_regs, causing the last element of the lg216x init block to be ignored. Spotted by Dan Carpenter. Reported-by: Dan Carpenter Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index a3ab1a5b6597..cc11260e99df 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, lg_reg("writing %d registers...\n", len); - for (i = 0; i < len - 1; i++) { + for (i = 0; i < len; i++) { ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); if (lg_fail(ret)) return ret;