]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: upl: initialize unit test state
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 2 Nov 2024 14:30:20 +0000 (15:30 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 15 Nov 2024 00:14:05 +0000 (18:14 -0600)
do_upl_write() calls upl_get_test_data() which may increment the fail
count in the unit test state. We should initialize it.

Addresses-Coverity-ID: 510465 Uninitialized scalar variable
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/upl.c

index 4996f36c787453ffd4355530f1554f4e7b2a1f89..c9a823bbc064a347508053e51887aab3f190a1a2 100644 (file)
--- a/cmd/upl.c
+++ b/cmd/upl.c
@@ -50,7 +50,7 @@ static int do_upl_write(struct cmd_tbl *cmdtp, int flag, int argc,
                        char *const argv[])
 {
        struct upl s_upl, *upl = &s_upl;
-       struct unit_test_state uts;
+       struct unit_test_state uts = { 0 };
        struct abuf buf;
        oftree tree;
        ulong addr;