-/* $OpenBSD: uipc_socket.c,v 1.302 2023/04/24 09:20:09 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.303 2023/04/28 12:53:42 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
if (sosplice_taskq == NULL) {
tq = taskq_create("sosplice", 1, IPL_SOFTNET,
TASKQ_MPSAFE);
+ if (tq == NULL) {
+ rw_exit_write(&sosplice_lock);
+ return (ENOMEM);
+ }
/* Ensure the taskq is fully visible to other CPUs. */
membar_producer();
sosplice_taskq = tq;
}
rw_exit_write(&sosplice_lock);
+ } else {
+ /* Ensure the taskq is fully visible on this CPU. */
+ membar_consumer();
}
- if (sosplice_taskq == NULL)
- return (ENOMEM);
if ((so->so_proto->pr_flags & PR_SPLICE) == 0)
return (EPROTONOSUPPORT);