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

This commit is contained in:
Pawel Jakub Dawidek 2010-12-14 06:19:13 +00:00
parent 82db8a5e35
commit b452cf6317
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216427

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