summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2022-08-10 20:19:23 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2022-08-10 20:19:23 +0000
commita4d82b73705da542a4fe30c3f591e19264e1e386 (patch)
treefcd7f98c370aae557f4706adddd1746b3c1980e6 /sys
parent7b88af744d69033695cf412d25125ab1c4f99a68 (diff)
Fix off-by-one in channel count, from NetBSD.
"Looks right" deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdt/bcm2835_dmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fdt/bcm2835_dmac.c b/sys/dev/fdt/bcm2835_dmac.c
index 0149839cf04..ccf4f839c88 100644
--- a/sys/dev/fdt/bcm2835_dmac.c
+++ b/sys/dev/fdt/bcm2835_dmac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcm2835_dmac.c,v 1.3 2022/06/28 16:29:03 anton Exp $ */
+/* $OpenBSD: bcm2835_dmac.c,v 1.4 2022/08/10 20:19:22 mglocker Exp $ */
/*
* Copyright (c) 2020 Tobias Heider <tobhe@openbsd.org>
@@ -170,7 +170,7 @@ bcmdmac_attach(struct device *parent, struct device *self, void *aux)
mtx_init(&sc->sc_lock, IPL_SCHED);
- sc->sc_nchannels = 31 - __builtin_clz(sc->sc_channelmask);
+ sc->sc_nchannels = 32 - __builtin_clz(sc->sc_channelmask);
sc->sc_channels = malloc(sizeof(*sc->sc_channels) * sc->sc_nchannels,
M_DEVBUF, M_WAITOK);