Vlv2TbltDevicePkg/PlatformFlashAccessLib: Add error return

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>
This commit is contained in:
Michael D Kinney 2019-05-08 14:34:58 -07:00
parent 21d5bf86b2
commit 3eac7496be
1 changed files with 5 additions and 1 deletions

View File

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