Commit Graph

3 Commits

Author SHA1 Message Date
Conrad Meyer
523af57ea2 nctgpio(4): Don't index past the end of sc->pins array
This driver thinks that the NCT_MAX_PIN index is a valid index in a few places
(nct_attach() for-loop, as well as NCT_IS_VALID_PIN()).  Allocate room for
NCT_MAX_PIN as an index, that is, NCT_MAX_PIN + 1 elements.

Reported by:	Coverity
CIDs:		1353806, 1353807, 1353808, 1353809, 1353810
Sponsored by:	EMC / Isilon Storage Division
2016-04-20 01:17:18 +00:00
Pedro F. Giffuni
73a1170a8c sys/dev: use our nitems() macro when it is avaliable through param.h.
No functional change, only trivial cases are done in this sweep,
Drivers that can get further enhancements will be done independently.

Discussed in:	freebsd-current
2016-04-19 23:37:24 +00:00
Adrian Chadd
6b7b2d80ed Add support for the Nuvoton NCT5104D.
Make it compile only for i386/amd64 for now as it's been tested there.
It's quite possible it'll show up elsewhere and we can enable it
for other architectures later.

Tested:

* PC Engines APU1C4

Submitted by:	Daniel Wyatt <daniel@dewyatt.com>
Reviewed by:	adrian, loos
Differential Revision:	https://reviews.freebsd.org/D5389
2016-03-31 04:57:38 +00:00