- OR the flag variable with M_ZERO so that the uma_zalloc() handles the

zero'ing out of the allocated memory.  Also removed the logical bzero
  that followed.
This commit is contained in:
Andrew R. Reiter 2002-05-21 21:18:41 +00:00
parent e6302957fe
commit 1515cd22e1

View File

@ -124,11 +124,10 @@ soalloc(waitok)
flag = M_WAITOK;
else
flag = M_NOWAIT;
flag |= M_ZERO;
so = uma_zalloc(socket_zone, flag);
if (so) {
/* XXX race condition for reentrant kernel */
bzero(so, sizeof *so);
so->so_gencnt = ++so_gencnt;
mtx_init(&so->so_rcv.sb_mtx, "sockbuf rcv", NULL, MTX_DEF);
mtx_init(&so->so_snd.sb_mtx, "sockbuf snd", NULL, MTX_DEF);