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>
/** @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
Progress (EndPercentage);\r
}\r
\r
+ if (FlashError) {\r
+ return EFI_WRITE_PROTECTED;\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
\r