tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: socket locking KASSERT fired
ad%netbsd.org@localhost said:
> I've checked that one in, thanks.
Thanks - there is one more suspicious spot, see the
second part of the patch.
best regards
Matthias
-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
#
# old_revision [2dc410dda332edfb8ff67edba8905af354ac4900]
#
# patch "sys/kern/uipc_socket.c"
# from [52b81314176cd90e5f8bc417f297b2879ba0dfc5]
# to [9266f03cc39413059bb8c7a9dd1faa5e941f08b5]
#
============================================================
--- sys/kern/uipc_socket.c 52b81314176cd90e5f8bc417f297b2879ba0dfc5
+++ sys/kern/uipc_socket.c 9266f03cc39413059bb8c7a9dd1faa5e941f08b5
@@ -567,8 +567,10 @@ solisten(struct socket *so, int backlog,
solock(so);
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING |
- SS_ISDISCONNECTING)) != 0)
+ SS_ISDISCONNECTING)) != 0) {
+ sounlock(so);
return (EOPNOTSUPP);
+ }
error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL,
NULL, NULL, l);
if (error != 0) {
@@ -706,12 +708,10 @@ soabort(struct socket *so)
error = (*so->so_proto->pr_usrreq)(so, PRU_ABORT, NULL,
NULL, NULL, NULL);
refs = --so->so_aborting; /* XXX */
- if (error) {
+ if (error || (refs == 0)) {
sofree(so);
} else {
sounlock(so);
- if (refs == 0)
- sofree(so);
}
return error;
}
Home |
Main Index |
Thread Index |
Old Index