summaryrefslogtreecommitdiffstats
path: root/sys/dev/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/gpio')
-rw-r--r--sys/dev/gpio/gpiobus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c
index 6abb10c..1b1f420 100644
--- a/sys/dev/gpio/gpiobus.c
+++ b/sys/dev/gpio/gpiobus.c
@@ -190,13 +190,13 @@ gpiobus_attach(device_t dev)
if (res)
return (ENXIO);
+ KASSERT(sc->sc_npins != 0, ("GPIO device with no pins"));
+
/*
* Increase to get number of pins
*/
sc->sc_npins++;
- KASSERT(sc->sc_npins != 0, ("GPIO device with no pins"));
-
sc->sc_pins_mapped = malloc(sizeof(int) * sc->sc_npins, M_DEVBUF,
M_NOWAIT | M_ZERO);
OpenPOWER on IntegriCloud