diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-21 15:42:36 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-21 15:42:36 +0000 |
commit | ac2fffa4b74cd83963f0d462c379c7f50eeabf20 (patch) | |
tree | 1f8fc635121499d467998c99ece5983a2d563840 /sys/dev/pst | |
parent | e09304d8f33887be9cc37817885061ccbb770d50 (diff) | |
download | src-ac2fffa4b74cd83963f0d462c379c7f50eeabf20.tar.gz src-ac2fffa4b74cd83963f0d462c379c7f50eeabf20.zip |
Revert r327828, r327949, r327953, r328016-r328026, r328041:
Uses of mallocarray(9).
The use of mallocarray(9) has rocketed the required swap to build FreeBSD.
This is likely caused by the allocation size attributes which put extra pressure
on the compiler.
Given that most of these checks are superfluous we have to choose better
where to use mallocarray(9). We still have more uses of mallocarray(9) but
hopefully this is enough to bring swap usage to a reasonable level.
Reported by: wosch
PR: 225197
Notes
Notes:
svn path=/head/; revision=328218
Diffstat (limited to 'sys/dev/pst')
-rw-r--r-- | sys/dev/pst/pst-iop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pst/pst-iop.c b/sys/dev/pst/pst-iop.c index b4819f35c72a..15fbf36b6328 100644 --- a/sys/dev/pst/pst-iop.c +++ b/sys/dev/pst/pst-iop.c @@ -323,7 +323,7 @@ iop_get_lct(struct iop_softc *sc) contigfree(reply, ALLOCSIZE, M_PSTIOP); return 0; } - if (!(sc->lct = mallocarray(reply->table_size, sizeof(struct i2o_lct_entry), + if (!(sc->lct = malloc(reply->table_size * sizeof(struct i2o_lct_entry), M_PSTIOP, M_NOWAIT | M_ZERO))) { contigfree(reply, ALLOCSIZE, M_PSTIOP); return 0; |