Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom off by one



details:   https://anonhg.NetBSD.org/src/rev/2e6c87194e52
branches:  trunk
changeset: 455260:2e6c87194e52
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Oct 12 09:46:18 2019 +0000

description:
off by one

diffstat:

 sys/arch/arm/broadcom/bcm2835_gpio.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0afa927aee08 -r 2e6c87194e52 sys/arch/arm/broadcom/bcm2835_gpio.c
--- a/sys/arch/arm/broadcom/bcm2835_gpio.c      Sat Oct 12 09:42:38 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_gpio.c      Sat Oct 12 09:46:18 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_gpio.c,v 1.15 2019/10/03 11:24:27 mlelstv Exp $        */
+/*     $NetBSD: bcm2835_gpio.c,v 1.16 2019/10/12 09:46:18 mlelstv Exp $        */
 
 /*-
  * Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.15 2019/10/03 11:24:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.16 2019/10/12 09:46:18 mlelstv Exp $");
 
 /*
  * Driver for BCM2835 GPIO
@@ -221,7 +221,7 @@
        for (int i = 0; i < npins; i++) {
                const u_int pin = be32toh(pins[i]);
 
-               if (pin > sc->sc_maxpins)
+               if (pin >= sc->sc_maxpins)
                        continue;
                if (pull) {
                        const int value = be32toh(pull[npull == 1 ? 0 : i]);



Home | Main Index | Thread Index | Old Index