diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-13 22:30:30 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-13 22:30:30 +0000 |
commit | 26c1d774b55c4db79bca772941883244986e6f44 (patch) | |
tree | 0d4a99e9eba470c0808a66d7d3f857c9f36446fa /sys/dev/advansys | |
parent | a019e26c0f76f5fd5c401cd87554ef2d5efc36ca (diff) | |
download | src-26c1d774b55c4db79bca772941883244986e6f44.tar.gz src-26c1d774b55c4db79bca772941883244986e6f44.zip |
dev: make some use of mallocarray(9).
Focus on code where we are doing multiplications within malloc(9). None of
these is likely to overflow, however the change is still useful as some
static checkers can benefit from the allocation attributes we use for
mallocarray.
This initial sweep only covers malloc(9) calls with M_NOWAIT. No good
reason but I started doing the changes before r327796 and at that time it
was convenient to make sure the sorrounding code could handle NULL values.
Notes
Notes:
svn path=/head/; revision=327949
Diffstat (limited to 'sys/dev/advansys')
-rw-r--r-- | sys/dev/advansys/advansys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c index bb6bffeb0758..8be56fb3cb4e 100644 --- a/sys/dev/advansys/advansys.c +++ b/sys/dev/advansys/advansys.c @@ -1255,7 +1255,7 @@ adv_attach(adv) * a transaction and use it for mapping the queue to the * upper level SCSI transaction it represents. */ - adv->ccb_infos = malloc(sizeof(*adv->ccb_infos) * adv->max_openings, + adv->ccb_infos = mallocarray(adv->max_openings, sizeof(*adv->ccb_infos), M_DEVBUF, M_NOWAIT); if (adv->ccb_infos == NULL) |