]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/TcpDxe/SockInterface.c
NetworkPkg: Fix issue the iSCSI client can not send reset packet.
[mirror_edk2.git] / NetworkPkg / TcpDxe / SockInterface.c
index b4ba40afcef620f9e6889c5866f10b4c9408aae4..0248cdf6ff62f68b96c2e9b6c2b635cc7e76f31c 100644 (file)
@@ -169,18 +169,6 @@ SockDestroyChild (
 \r
   ASSERT (Tcb != NULL);\r
 \r
-  Status            = EfiAcquireLockOrFail (&(Sock->Lock));\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    DEBUG (\r
-      (EFI_D_ERROR,\r
-      "SockDestroyChild: Get the lock to access socket failed with %r\n",\r
-      Status)\r
-      );\r
-\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
   //\r
   // Close the IP protocol.\r
   //\r
@@ -226,6 +214,19 @@ SockDestroyChild (
         NULL\r
         );\r
 \r
+\r
+  Status            = EfiAcquireLockOrFail (&(Sock->Lock));\r
+  if (EFI_ERROR (Status)) {\r
+\r
+    DEBUG (\r
+      (EFI_D_ERROR,\r
+      "SockDestroyChild: Get the lock to access socket failed with %r\n",\r
+      Status)\r
+      );\r
+\r
+    return EFI_ACCESS_DENIED;\r
+  }\r
+\r
   //\r
   // force protocol layer to detach the PCB\r
   //\r