]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: make some use of mallocarray(9).
authorPedro F. Giffuni <pfg@FreeBSD.org>
Mon, 15 Jan 2018 21:18:04 +0000 (21:18 +0000)
committerPedro F. Giffuni <pfg@FreeBSD.org>
Mon, 15 Jan 2018 21:18:04 +0000 (21:18 +0000)
commita18a2290cd704e9348285c150c9c6e1d9a2493ff
treec6af80c646bf5aadb34f49978bff794a9536f6c6
parent0699955838130d85fbc325ba019b4613c9b3fef8
kern: make some use of mallocarray(9).

Focus on code where we are doing multiplications within malloc(9). None of
these ire 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.

X-Differential revision: https://reviews.freebsd.org/D13837
sys/kern/init_main.c
sys/kern/kern_cpu.c
sys/kern/kern_ctf.c
sys/kern/kern_pmc.c
sys/kern/subr_bus.c
sys/kern/subr_taskqueue.c
sys/kern/subr_vmem.c