mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Move the KASSERT() check to the point before the increase of number of pins.
Approved by: adrian (mentor)
This commit is contained in:
parent
8ad579cac3
commit
a1f621566e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258047
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue