unix/stream: fix instant panic w/o INVARIANTS
A stupid microoptimization I made leaving empty STAILQ inconsistent
is a brainfart that is related to much earlier version of this code,
where it was safe to do so.
Pointy hat to: glebius
Fixes: 69f61cee2e
This commit is contained in:
@@ -1492,11 +1492,10 @@ uipc_soreceive_stream_or_seqpacket(struct socket *so, struct sockaddr **psa,
|
||||
}
|
||||
|
||||
if (!peek) {
|
||||
STAILQ_FIRST(&sb->uxst_mbq) = next;
|
||||
#ifdef INVARIANTS
|
||||
if (next == NULL)
|
||||
STAILQ_INIT(&sb->uxst_mbq);
|
||||
#endif
|
||||
else
|
||||
STAILQ_FIRST(&sb->uxst_mbq) = next;
|
||||
MPASS(sb->sb_acc >= datalen);
|
||||
sb->sb_acc -= datalen;
|
||||
sb->sb_ccc -= datalen;
|
||||
|
||||
Reference in New Issue
Block a user