summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-24 09:20:10 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-24 09:20:10 +0000
commit771f0b63b60be687195042f5b6b40c9a41341a6a (patch)
tree5ad266bef6745ee469d3e8c7a959f1d9d73ff78a /sys
parentac0822cbc78ef8bda382138fc6901ff422939b08 (diff)
Don't check `so_sp' within sofree(). The following isspliced() and
issplicedback() already have this check. ok bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_socket.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 0ca3727ccbd..3c8d08b774a 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.301 2023/02/10 14:34:17 visa Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.302 2023/04/24 09:20:09 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -316,21 +316,19 @@ sofree(struct socket *so, int keep_lock)
klist_free(&so->so_rcv.sb_klist);
klist_free(&so->so_snd.sb_klist);
#ifdef SOCKET_SPLICE
- if (so->so_sp) {
- if (issplicedback(so)) {
- int freeing = SOSP_FREEING_WRITE;
+ if (issplicedback(so)) {
+ int freeing = SOSP_FREEING_WRITE;
- if (so->so_sp->ssp_soback == so)
- freeing |= SOSP_FREEING_READ;
- sounsplice(so->so_sp->ssp_soback, so, freeing);
- }
- if (isspliced(so)) {
- int freeing = SOSP_FREEING_READ;
+ if (so->so_sp->ssp_soback == so)
+ freeing |= SOSP_FREEING_READ;
+ sounsplice(so->so_sp->ssp_soback, so, freeing);
+ }
+ if (isspliced(so)) {
+ int freeing = SOSP_FREEING_READ;
- if (so == so->so_sp->ssp_socket)
- freeing |= SOSP_FREEING_WRITE;
- sounsplice(so, so->so_sp->ssp_socket, freeing);
- }
+ if (so == so->so_sp->ssp_socket)
+ freeing |= SOSP_FREEING_WRITE;
+ sounsplice(so, so->so_sp->ssp_socket, freeing);
}
#endif /* SOCKET_SPLICE */
sbrelease(so, &so->so_snd);