svn commit: r258047 - head/sys/dev/gpio
Luiz Otavio O Souza
loos at FreeBSD.org
Tue Nov 12 13:55:19 UTC 2013
Author: loos
Date: Tue Nov 12 13:55:19 2013
New Revision: 258047
URL: http://svnweb.freebsd.org/changeset/base/258047
Log:
Move the KASSERT() check to the point before the increase of number of pins.
Approved by: adrian (mentor)
Modified:
head/sys/dev/gpio/gpiobus.c
Modified: head/sys/dev/gpio/gpiobus.c
==============================================================================
--- head/sys/dev/gpio/gpiobus.c Tue Nov 12 13:44:50 2013 (r258046)
+++ head/sys/dev/gpio/gpiobus.c Tue Nov 12 13:55:19 2013 (r258047)
@@ -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);
More information about the svn-src-head
mailing list