diff mbox series

[edk2,RFC,edk2-platforms,1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found

Message ID 20180316161322.6756-2-ard.biesheuvel@linaro.org
State New
Headers show
Series expand capsule to include SCP firmware | expand

Commit Message

Ard Biesheuvel March 16, 2018, 4:13 p.m. UTC
If no suitable FVB protocol implementation is found to apply the capsule
update, and the last one we disregarded was ruled out because it has the
read-only attribute, we will exit the function returning EFI_SUCCESS
without assigning a value to *OutFvb, resulting in a crash when it
subsequently gets dereferenced. So set the correct value for Status for
that case.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.15.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index fbb8f1f9e48c..1af4abc16aa5 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -99,6 +99,7 @@  GetFvbByAddress (
       DEBUG ((DEBUG_INFO,
         "%a: ignoring read-only FVB protocol implementation\n",
         __FUNCTION__));
+      Status = EFI_NOT_FOUND;
       continue;
     }