LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mfd: tps65911-comparator: Fix an off by one bug
@ 2018-04-19 13:46 Dan Carpenter
  2018-04-20  8:09 ` Lee Jones
  2018-04-20  8:59 ` [PATCH] " Dan Carpenter
  0 siblings, 2 replies; 15+ messages in thread
From: Dan Carpenter @ 2018-04-19 13:46 UTC (permalink / raw)
  To: Lee Jones, Jorge Eduardo Candelaria; +Cc: linux-kernel, kernel-janitors

The tps_comparators[] array is used in two places.  We only access the
COMP1 (1) and COMP2 (2) elements.  Unfortunately, we're accessing the
wrong elements and also one element beyond the end of the array.  There
was supposed to be a zero element at the start of the array which is
isn't accessed but makes the math work out nicely.

Fixes: 6851ad3ab346 ("TPS65911: Comparator: Add comparator driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I can't actually compile this code...

diff --git a/drivers/mfd/tps65911-comparator.c b/drivers/mfd/tps65911-comparator.c
index c0789f81a1c5..35d7380f6fad 100644
--- a/drivers/mfd/tps65911-comparator.c
+++ b/drivers/mfd/tps65911-comparator.c
@@ -42,6 +42,7 @@ struct comparator {
 };
 
 static struct comparator tps_comparators[] = {
+	{	.name = "COMP", },
 	{
 		.name = "COMP1",
 		.reg = TPS65911_VMBCH,

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

end of thread, other threads:[~2018-04-24  5:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 13:46 [PATCH] mfd: tps65911-comparator: Fix an off by one bug Dan Carpenter
2018-04-20  8:09 ` Lee Jones
2018-04-20  8:21   ` Dan Carpenter
2018-04-20  8:24     ` Dan Carpenter
2018-04-20  8:39     ` Lee Jones
2018-04-20  9:01       ` Dan Carpenter
2018-04-23  6:26         ` Lee Jones
2018-04-20  9:09       ` [PATCH v2] " Dan Carpenter
2018-04-23  6:44         ` Lee Jones
2018-04-23 10:27           ` Dan Carpenter
2018-04-24  5:45             ` Lee Jones
2018-04-20  8:59 ` [PATCH] " Dan Carpenter
2018-04-20  9:21   ` [PATCH] mfd: tps65911-comparator: Fix a build error Dan Carpenter
2018-04-23 18:13     ` Rhyland Klein
2018-04-24  5:46     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).