From 5a0192650e16a893fab7c7bb2e37fd7caa51d366 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sat, 21 Aug 2004 17:38:48 +0000 Subject: [PATCH] When notifying protocol components of an event on an in6pcb, use the result of the notify() function to decide if we need to unlock the in6pcb or not, rather than always unlocking. Otherwise, we may unlock and already unlocked in6pcb. Reported by: kuriyama, Gordon Bergling Tested by: kuriyama, Gordon Bergling Discussed with: mdodd --- sys/netinet6/in6_pcb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 7639919e8a8..9bcbeb82d3c 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -705,9 +705,11 @@ in6_pcbnotify(pcbinfo, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify) } do_notify: - if (notify) - (*notify)(inp, errno); - INP_UNLOCK(inp); + if (notify) { + if ((*notify)(inp, errno)) + INP_UNLOCK(inp); + } else + INP_UNLOCK(inp); } INP_INFO_WUNLOCK(pcbinfo); splx(s);