Skip to content

Commit

Permalink
[media] lg2160: fix off-by-one error in lg216x_write_regs
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jun 11, 2012
1 parent 87736df commit bffaecc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/frontends/lg2160.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bffaecc

Please sign in to comment.