[PATCH] uefirtvariable: setvariable without deleting the original variable (LP: #1354301)

Ivan Hu ivan.hu at canonical.com
Fri Aug 8 09:59:01 UTC 2014


The setvariable_test2 tests the UEFI setvariable runtime service with the
same and different variable data. When doing the test, it should exist the
original variable on the system, the original variable should not be deleted.

Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index 21a8cbc..6a22c80 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -1012,35 +1012,25 @@ static int setvariable_test2(fwts_framework *fw, uint16_t *varname)
 	if (ret != FWTS_OK)
 		goto err_restore_env1;
 
-	ret = setvariable_insertvariable(fw, attributes, 0,
-		varname, &gtestguid1, datadiff1);
-	if (ret != FWTS_OK)
-		return ret;
-
 	/* insert different data */
 	datasize = 20;
 
 	ret = setvariable_insertvariable(fw, attributes, datasize,
 		varname, &gtestguid1, datadiff2);
 	if (ret != FWTS_OK)
-		return ret;
+		goto err_restore_env1;
 
 	ret = setvariable_checkvariable(fw, datasize, varname,
 		&gtestguid1, datadiff2);
 	if (ret != FWTS_OK)
 		goto err_restore_env2;
 
-	ret = setvariable_insertvariable(fw, attributes, 0,
-		varname, &gtestguid1, datadiff2);
-	if (ret != FWTS_OK)
-		return ret;
-
 	datasize = 5;
 
 	ret = setvariable_insertvariable(fw, attributes, datasize,
 		varname, &gtestguid1, datadiff3);
 	if (ret != FWTS_OK)
-		return ret;
+		goto err_restore_env2;
 
 	ret = setvariable_checkvariable(fw, datasize, varname,
 		&gtestguid1, datadiff3);
-- 
1.7.9.5




More information about the fwts-devel mailing list