tipc: Fix race condition when creating socket or native port

This patch eliminates the (very remote) chance of a crash resulting
from a partially initialized socket or native port unexpectedly
receiving a message.  Now, during the creation of a socket or native
port, the underlying generic port's lock is not released until all
initialization required to handle incoming messages has been done.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Allan Stephens
2008-05-12 15:42:28 -07:00
committed by David S. Miller
parent 4e3e6dcb43
commit 7ef43ebaa5
5 changed files with 27 additions and 14 deletions

View File

@@ -474,6 +474,7 @@ static void subscr_named_msg_event(void *usr_handle,
kfree(subscriber);
return;
}
spin_unlock_bh(subscriber->lock);
/* Establish a connection to subscriber */