[openib-general] [PATCH] PUT after UNLOCK

Michael S. Tsirkin mst at mellanox.co.il
Tue Feb 22 01:42:21 PST 2005


SDP_CONN_PUT was called before SDP_CONN_UNLOCK.
If this is the last reference, the connection could be removed
and an attempt to unlock would crash.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: sdp_inet.c
===================================================================
--- sdp_inet.c	(revision 1857)
+++ sdp_inet.c	(working copy)
@@ -716,9 +716,9 @@ static int _sdp_inet_connect(struct sock
 			sock->state = SS_UNCONNECTED;
 			conn->istate = SDP_SOCK_ST_CLOSED;
 
+			SDP_CONN_UNLOCK(conn);
 			SDP_CONN_PUT(conn);	/* CM reference */
-
-			goto done;
+			return result;
 		}
 
 		inet_sk(sk)->daddr = htonl(conn->dst_addr);


-- 
MST - Michael S. Tsirkin



More information about the general mailing list