summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2013-09-06 23:39:56 +0000
committerloos <loos@FreeBSD.org>2013-09-06 23:39:56 +0000
commitb6096f6e1ef3c9bf35a1fe78f7576c4beb6b7762 (patch)
tree0d2d66c2f7a38aadf2be5d27a5cd06bf3045fbb3 /sys/mips
parent65d6047074a51f5cc6c10b5856ad1438c252df7e (diff)
downloadFreeBSD-src-b6096f6e1ef3c9bf35a1fe78f7576c4beb6b7762.zip
FreeBSD-src-b6096f6e1ef3c9bf35a1fe78f7576c4beb6b7762.tar.gz
Fix an off-by-one bug in ar71xx_gpio and bcm2835_gpio which makes the last
pin unavailable. Reported and tested by: sbruno (ar71xx) Approved by: adrian (mentor) Pointy hat to: loos
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/atheros/ar71xx_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/mips/atheros/ar71xx_gpio.c b/sys/mips/atheros/ar71xx_gpio.c
index 6ad8df4..0c2e528 100644
--- a/sys/mips/atheros/ar71xx_gpio.c
+++ b/sys/mips/atheros/ar71xx_gpio.c
@@ -418,7 +418,7 @@ ar71xx_gpio_attach(device_t dev)
"pinon", &pinon) != 0)
pinon = 0;
device_printf(dev, "gpio pinmask=0x%x\n", mask);
- for (i = 0, j = 0; j < maxpin; j++) {
+ for (i = 0, j = 0; j <= maxpin; j++) {
if ((mask & (1 << j)) == 0)
continue;
snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME,
OpenPOWER on IntegriCloud