Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.

This commit is contained in:
pjd 2010-12-14 06:19:13 +00:00
parent c879c327e5
commit 627e6dcc72

View File

@ -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");
}