]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SignedCapsulePkg/SystemFirmwareReportDxe: Pass thru on same handle
authorKinney, Michael D <michael.d.kinney@intel.com>
Mon, 9 Apr 2018 22:47:19 +0000 (15:47 -0700)
committerKinney, Michael D <michael.d.kinney@intel.com>
Wed, 11 Apr 2018 17:08:36 +0000 (10:08 -0700)
https://bugzilla.tianocore.org/show_bug.cgi?id=928

Use HandleProtocol() to pass thru a SetImage() call to the
System FMP Protocol that must be on the same handle as the
FMP Protocol.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c

index f5f9827c7764e7f6b94ac7f37961565f10c35785..e750e5d4ced187f6b944ef78e613cfe2622b4c41 100644 (file)
@@ -8,7 +8,7 @@
 \r
   FmpSetImage() will receive untrusted input and do basic validation.\r
 \r
 \r
   FmpSetImage() will receive untrusted input and do basic validation.\r
 \r
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -194,9 +194,13 @@ FmpSetImage (
   }\r
 \r
   //\r
   }\r
 \r
   //\r
-  // Pass Thru\r
+  // Pass Thru to System FMP Protocol on same handle as FMP Protocol\r
   //\r
   //\r
-  Status = gBS->LocateProtocol(&gSystemFmpProtocolGuid, NULL, (VOID **)&SystemFmp);\r
+  Status = gBS->HandleProtocol(\r
+                  SystemFmpPrivate->Handle,\r
+                  &gSystemFmpProtocolGuid,\r
+                  (VOID **)&SystemFmp\r
+                  );\r
   if (EFI_ERROR(Status)) {\r
     DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));\r
     SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;\r
   if (EFI_ERROR(Status)) {\r
     DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));\r
     SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;\r