Rather than checking for a NULL so_pcb in raw_attach(), assert that

it's non-NULL, as all callers can and should already do the required
checking.  Update comments a bit more to talk about rawcb allocation
for consumers.

Reviewed by:	bz
MFC after:	3 weeks
This commit is contained in:
Robert Watson 2008-07-09 18:41:31 +00:00
parent 44cfd3765f
commit 7e06585752

View File

@ -78,12 +78,13 @@ raw_attach(struct socket *so, int proto)
int error;
/*
* It is assumed that raw_attach is called
* after space has been allocated for the
* rawcb.
* It is assumed that raw_attach is called after space has been
* allocated for the rawcb; consumer protocols may simply allocate
* type struct rawcb, or a wrapper data structure that begins with a
* struct rawcb.
*/
if (rp == 0)
return (ENOBUFS);
KASSERT(rp != NULL, ("raw_attach: rp == NULL"));
error = soreserve(so, raw_sendspace, raw_recvspace);
if (error)
return (error);