diff options
| author | 2014-12-13 21:05:32 +0000 | |
|---|---|---|
| committer | 2014-12-13 21:05:32 +0000 | |
| commit | f8238f3e71a8eb02e65b90db598fa2664cb0a2c7 (patch) | |
| tree | d1d22656f8480e9375f3f277691d9ca2527e7d8e /sys/kern/sched_bsd.c | |
| parent | Sort members by size to reduce structure padding (diff) | |
| download | wireguard-openbsd-f8238f3e71a8eb02e65b90db598fa2664cb0a2c7.tar.xz wireguard-openbsd-f8238f3e71a8eb02e65b90db598fa2664cb0a2c7.zip | |
yet more mallocarray() changes.
ok tedu@ deraadt@
Diffstat (limited to 'sys/kern/sched_bsd.c')
| -rw-r--r-- | sys/kern/sched_bsd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index 113b3017dd0..3472681590f 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sched_bsd.c,v 1.39 2014/11/12 22:27:45 tedu Exp $ */ +/* $OpenBSD: sched_bsd.c,v 1.40 2014/12/13 21:05:33 doug Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -598,11 +598,11 @@ setperf_auto(void *v) return; if (!idleticks) - if (!(idleticks = malloc(sizeof(*idleticks) * ncpusfound, + if (!(idleticks = mallocarray(ncpusfound, sizeof(*idleticks), M_DEVBUF, M_NOWAIT | M_ZERO))) return; if (!totalticks) - if (!(totalticks = malloc(sizeof(*totalticks) * ncpusfound, + if (!(totalticks = mallocarray(ncpusfound, sizeof(*totalticks), M_DEVBUF, M_NOWAIT | M_ZERO))) { free(idleticks, M_DEVBUF, sizeof(*idleticks) * ncpusfound); |
