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:
rwatson 2008-07-09 18:41:31 +00:00
parent 10a3215125
commit ee5ac1d2dd

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