tipc: Fix race condition when creating socket or native port
authorAllan Stephens <allan.stephens@windriver.com>
Mon, 12 May 2008 22:42:28 +0000 (15:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 May 2008 22:42:28 +0000 (15:42 -0700)
commit7ef43ebaa538e0cc9063cbf84593a05091bcace2
treed2bac748f6620cc2f217672105918b2116f6c958
parent4e3e6dcb43c3669a8817cb3d0f920f91661afd98
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>
include/net/tipc/tipc_port.h
net/tipc/port.c
net/tipc/ref.c
net/tipc/socket.c
net/tipc/subscr.c