[ros-diffs] [cgutman] 44845: [IP] - Fix a small locking issue in TCPClose

cgutman at svn.reactos.org cgutman at svn.reactos.org
Fri Jan 1 06:58:37 CET 2010


Author: cgutman
Date: Fri Jan  1 06:58:37 2010
New Revision: 44845

URL: http://svn.reactos.org/svn/reactos?rev=44845&view=rev
Log:
[IP]
 - Fix a small locking issue in TCPClose

Modified:
    branches/aicom-network-branch/lib/drivers/ip/transport/tcp/tcp.c

Modified: branches/aicom-network-branch/lib/drivers/ip/transport/tcp/tcp.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/lib/drivers/ip/transport/tcp/tcp.c?rev=44845&r1=44844&r2=44845&view=diff
==============================================================================
--- branches/aicom-network-branch/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ branches/aicom-network-branch/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Fri Jan  1 06:58:37 2010
@@ -731,24 +731,26 @@
      * closure anymore but we still need it to determine
      * if we caused the closure
      */
+    LockObject(Connection, &OldIrql);
     Socket = Connection->SocketContext;
     Connection->SocketContext = NULL;
 
     /* We need to close here otherwise oskit will never indicate
      * SEL_FIN and we will never fully close the connection
      */
-    LockObject(Connection, &OldIrql);
     Status = TCPTranslateError( OskitTCPClose( Socket ) );
-    UnlockObject(Connection, OldIrql);
 
     if (!NT_SUCCESS(Status))
     {
         Connection->SocketContext = Socket;
+        UnlockObject(Connection, OldIrql);
         return Status;
     }
 
     if (Connection->AddressFile)
         DereferenceObject(Connection->AddressFile);
+
+    UnlockObject(Connection, OldIrql);
 
     DereferenceObject(Connection);
 




More information about the Ros-diffs mailing list