[PATCH] efi: uefirtvariable: fix build error on Ubuntu Precise

Colin King colin.king at canonical.com
Wed Mar 4 09:03:35 UTC 2015


From: Colin Ian King <colin.king at canonical.com>

Initialise return value in ret, fixes build warning from gcc:

uefi/uefirtvariable/uefirtvariable.c: In function 'getnextvariable_test1':
uefi/uefirtvariable/uefirtvariable.c:302:6: error: 'ret' may be used
  uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
make[4]: *** [uefi/uefirtvariable/fwts-uefirtvariable.o] Error 1

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index ee41144..d47f50e 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -299,7 +299,7 @@ static int getnextvariable_test1(fwts_framework *fw)
 	uint16_t *variablename;
 	EFI_GUID vendorguid;
 	bool found_name = false, found_guid = false;
-	int ret;
+	int ret = FWTS_OK;
 
 	for (dataindex = 0; dataindex < datasize; dataindex++)
 		data[dataindex] = (uint8_t)dataindex;
-- 
2.1.4




More information about the fwts-devel mailing list