blob: fca232f02b38c815ed07bb01e16c9def92854059 [file] [log] [blame]
Andrew Geissler80d41842023-09-11 08:36:15 -04001Platform/ARM: fix uninitialized variable FileSize in RunAxf
2
3Clang 14 detects a potentially uninitialized variable FileSize:
4
5RunAxf.c:216:11: error: variable 'FileSize' is used uninitialized
6 whenever 'if' condition is false
7RunAxf.c:281:38: note: uninitialized use occurs here
8WriteBackDataCacheRange (FileData, FileSize);
9 ^~~~~~~~
10
11Reading the code it doesn't look like this can actually happen, but we
12can keep clang happy by initialising FileSize to 0.
13
14Upstream-Status: Pending
15Signed-off-by: Ross Burton <ross.burton@arm.com>
16
17diff --git a/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c b/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c
18index d23739ad38..fba5e0ba30 100644
19--- a/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c
20+++ b/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c
21@@ -136,1 +136,1 @@ ShellDynCmdRunAxfHandler (
22- UINTN FileSize;
23+ UINTN FileSize = 0;