All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] dvb/frontends/tda18271-common.c: fix off-by-one
@ 2008-01-28 22:12 Adrian Bunk
  2008-01-28 22:14 ` mkrufky
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2008-01-28 22:12 UTC (permalink / raw)
  To: Michael Krufky, Mauro Carvalho Chehab; +Cc: v4l-dvb-maintainer, linux-kernel

This patch fixes an off-by-one error spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/media/dvb/frontends/tda18271-common.c.old	2008-01-28 16:27:55.000000000 +0200
+++ linux-2.6/drivers/media/dvb/frontends/tda18271-common.c	2008-01-28 16:28:38.000000000 +0200
@@ -166,17 +166,17 @@ int tda18271_read_extended(struct dvb_fr
 	/* read all registers */
 	ret = i2c_transfer(priv->i2c_adap, msg, 2);
 
 	tda18271_i2c_gate_ctrl(fe, 0);
 
 	if (ret != 2)
 		tda_err("ERROR: i2c_transfer returned: %d\n", ret);
 
-	for (i = 0; i <= TDA18271_NUM_REGS; i++) {
+	for (i = 0; i < TDA18271_NUM_REGS; i++) {
 		/* don't update write-only registers */
 		if ((i != R_EB9)  &&
 		    (i != R_EB16) &&
 		    (i != R_EB17) &&
 		    (i != R_EB19) &&
 		    (i != R_EB20))
 		regs[i] = regdump[i];
 	}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-28 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-28 22:12 [2.6 patch] dvb/frontends/tda18271-common.c: fix off-by-one Adrian Bunk
2008-01-28 22:14 ` mkrufky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.