summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TcpDxe/SockInterface.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/TcpDxe/SockInterface.c')
-rw-r--r--NetworkPkg/TcpDxe/SockInterface.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/NetworkPkg/TcpDxe/SockInterface.c b/NetworkPkg/TcpDxe/SockInterface.c
index b4ba40afce..0248cdf6ff 100644
--- a/NetworkPkg/TcpDxe/SockInterface.c
+++ b/NetworkPkg/TcpDxe/SockInterface.c
@@ -169,18 +169,6 @@ SockDestroyChild (
ASSERT (Tcb != NULL);
- Status = EfiAcquireLockOrFail (&(Sock->Lock));
- if (EFI_ERROR (Status)) {
-
- DEBUG (
- (EFI_D_ERROR,
- "SockDestroyChild: Get the lock to access socket failed with %r\n",
- Status)
- );
-
- return EFI_ACCESS_DENIED;
- }
-
//
// Close the IP protocol.
//
@@ -226,6 +214,19 @@ SockDestroyChild (
NULL
);
+
+ Status = EfiAcquireLockOrFail (&(Sock->Lock));
+ if (EFI_ERROR (Status)) {
+
+ DEBUG (
+ (EFI_D_ERROR,
+ "SockDestroyChild: Get the lock to access socket failed with %r\n",
+ Status)
+ );
+
+ return EFI_ACCESS_DENIED;
+ }
+
//
// force protocol layer to detach the PCB
//