diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index c2ba9535472..9c5c9719c20 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -348,7 +348,7 @@ kern_accept4(struct thread *td, int s, struct sockaddr **name, &headfp, &fcaps); if (error != 0) return (error); - fflag = atomic_load_int(&fp->f_flag); + fflag = atomic_load_int(&headfp->f_flag); head = headfp->f_data; if (!SOLISTENING(head)) { error = EINVAL; diff --git a/sys/netinet/sctp_syscalls.c b/sys/netinet/sctp_syscalls.c index a58ba9c231f..5ae1da98e5d 100644 --- a/sys/netinet/sctp_syscalls.c +++ b/sys/netinet/sctp_syscalls.c @@ -157,7 +157,7 @@ sys_sctp_peeloff(td, uap) &headfp); if (error != 0) goto done2; - fflag = atomic_load_int(&fp->f_flag); + fflag = atomic_load_int(&headfp->f_flag); head = headfp->f_data; if (head->so_proto->pr_protocol != IPPROTO_SCTP) { error = EOPNOTSUPP;