From fb4eec0d30638f55b7e34e2520c07e6a9c3b9966 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 1 Jan 2010 05:58:37 +0000 Subject: [PATCH] [IP] - Fix a small locking issue in TCPClose svn path=/branches/aicom-network-branch/; revision=44845 --- lib/drivers/ip/transport/tcp/tcp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/drivers/ip/transport/tcp/tcp.c b/lib/drivers/ip/transport/tcp/tcp.c index 97d051916eb..ae02e4a2d05 100644 --- a/lib/drivers/ip/transport/tcp/tcp.c +++ b/lib/drivers/ip/transport/tcp/tcp.c @@ -731,25 +731,27 @@ NTSTATUS TCPClose * 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); return Status; -- 2.17.1