diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-22 02:08:10 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-22 02:08:10 +0000 |
commit | d821d36419a2ec7c61435759467139bde2613468 (patch) | |
tree | f469fa2de1347fb08ba66d2b41c9cab5eccfe14c /sys/dev/mps | |
parent | b8d1747e755f88c678adc272fb4d356715288197 (diff) | |
download | src-d821d36419a2ec7c61435759467139bde2613468.tar.gz src-d821d36419a2ec7c61435759467139bde2613468.zip |
Unsign some values related to allocation.
When allocating memory through malloc(9), we always expect the amount of
memory requested to be unsigned as a negative value would either stand for
an error or an overflow.
Unsign some values, found when considering the use of mallocarray(9), to
avoid unnecessary casting. Also consider that indexes should be of
at least the same size/type as the upper limit they pretend to index.
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=328238
Diffstat (limited to 'sys/dev/mps')
-rw-r--r-- | sys/dev/mps/mps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 2f684bdd3c6e..766b77134fe3 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -1164,7 +1164,7 @@ static int mps_alloc_queues(struct mps_softc *sc) { struct mps_queue *q; - int nq, i; + u_int nq, i; nq = sc->msi_msgs; mps_dprint(sc, MPS_INIT|MPS_XINFO, "Allocating %d I/O queues\n", nq); |