Commit bffaecc7 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

[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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 87736df2
...@@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state, ...@@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state,
lg_reg("writing %d registers...\n", len); 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); ret = lg216x_write_reg(state, regs[i].reg, regs[i].val);
if (lg_fail(ret)) if (lg_fail(ret))
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment