diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2010-12-14 06:19:13 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2010-12-14 06:19:13 +0000 |
commit | b452cf6317c7f152a6e43260a6efe4aa1fb8f545 (patch) | |
tree | c5066c64dba1df9183ec939dac19e8faf76fb160 /sys/kern/uipc_syscalls.c | |
parent | 82db8a5e356d747d2f2473ad65dfdda1d5d9d655 (diff) | |
download | src-b452cf6317c7f152a6e43260a6efe4aa1fb8f545.tar.gz src-b452cf6317c7f152a6e43260a6efe4aa1fb8f545.zip |
Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.
Notes
Notes:
svn path=/head/; revision=216427
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 06869b21d283..459082b18c9a 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1888,8 +1888,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap, mnw = 1; if (uap->flags & SF_SYNC) { - sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK); - memset(sfs, 0, sizeof *sfs); + sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); } |