]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6Driver.c
MdePkg/BaseIoLibIntrinsic: make BaseIoLibIntrinsic safe for ArmVirt/KVM
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6Driver.c
index f2df200602abfdfc4aaf0dcf380abc7006b568ad..0797a742f23ad03c7b6080c7c5b1b004491b5cf0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The driver binding and service binding protocol for IP6 driver.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
 \r
   This program and the accompanying materials\r
@@ -41,14 +41,20 @@ IpSec2InstalledCallback (
   IN VOID       *Context\r
   )\r
 {\r
+  EFI_STATUS    Status;\r
   //\r
-  // Close the event so it does not get called again.\r
+  // Test if protocol was even found.\r
+  // Notification function will be called at least once.\r
   //\r
-  gBS->CloseEvent (Event);\r
-\r
-  mIpSec2Installed = TRUE;\r
+  Status = gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **)&mIpSec);\r
+  if (Status == EFI_SUCCESS && mIpSec != NULL) {\r
+    //\r
+    // Close the event so it does not get called again.\r
+    //\r
+    gBS->CloseEvent (Event);\r
 \r
-  return;\r
+    mIpSec2Installed = TRUE;\r
+  }\r
 }\r
 \r
 /**\r
@@ -796,7 +802,7 @@ Exit:
                                  the existing child handle.\r
 \r
   @retval EFI_SUCCES             The child handle was created with the I/O services.\r
-  @retval EFI_OUT_OF_RESOURCES   There are not enough resources availabe to create\r
+  @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to create\r
                                  the child.\r
   @retval other                  The child handle was not created.\r
 \r