From 3eac7496bef1636b3745ff015581012534a47721 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Wed, 8 May 2019 14:34:58 -0700 Subject: [PATCH] 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 Cc: Yi Qian Signed-off-by: Michael D Kinney Reviewed-by: Zailiang Sun Reviewed-by: Yi Qian --- .../Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c b/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c index 052ccb891c..079c3ef2d6 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c +++ b/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c @@ -1,7 +1,7 @@ /** @file Platform Flash Access library. - Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -529,6 +529,10 @@ Done: Progress (EndPercentage); } + if (FlashError) { + return EFI_WRITE_PROTECTED; + } + return EFI_SUCCESS; }