]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
socket: Add assertions around naked refcount decrements
authorMark Johnston <markj@FreeBSD.org>
Fri, 17 Sep 2021 16:26:56 +0000 (12:26 -0400)
committerMark Johnston <markj@FreeBSD.org>
Fri, 24 Sep 2021 13:03:04 +0000 (09:03 -0400)
commit5a9ecb0b1505b4830c67b586164be7593ba32bf4
tree964001e4ef120e0a2ffef71661f06363339f5fcf
parente9e4f8092c2e0ccac922f930072cd14b22ee7c1c
socket: Add assertions around naked refcount decrements

Sockets in a listen queue hold a reference to the parent listening
socket.  Several code paths release this reference manually when moving
a child socket out of the queue.

Replace comments about the expected post-decrement refcount value with
assertions.  Use refcount_load() instead of a plain load.  No functional
change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b288408ca32e68c74f6ab12324448ab4862a045)
sys/kern/uipc_socket.c