]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Vlv2TbltDevicePkg/PlatformFlashAccessLib: Add error return
authorMichael D Kinney <michael.d.kinney@intel.com>
Wed, 8 May 2019 21:34:58 +0000 (14:34 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Fri, 10 May 2019 02:58:05 +0000 (19:58 -0700)
If the FLASH device cannot be erased or written, then the
flag FlashError is set to TRUE.

Add the missing logic to return an error if FlashError
is TRUE.  The missing logic was found from a GCC build that
noticed a local variable was declared and assigned, but was
not being used.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Yi Qian <yi.qian@intel.com>
Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c

index 052ccb891c0d7e3abd41f0fb86165f8cb44fc174..079c3ef2d68e975227bc472c03acc7c8b77cce2d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Platform Flash Access library.\r
 \r
-  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -529,6 +529,10 @@ Done:
     Progress (EndPercentage);\r
   }\r
 \r
+  if (FlashError) {\r
+    return EFI_WRITE_PROTECTED;\r
+  }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r