ACK: [PATCH] uefirtvariable: setvariable without deleting the original variable (LP: #1354301)
Alex Hung
alex.hung at canonical.com
Mon Aug 11 02:26:52 UTC 2014
On 08/08/2014 05:59 PM, Ivan Hu wrote:
> 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, >estguid1, datadiff1);
> - if (ret != FWTS_OK)
> - return ret;
> -
> /* insert different data */
> datasize = 20;
>
> ret = setvariable_insertvariable(fw, attributes, datasize,
> varname, >estguid1, datadiff2);
> if (ret != FWTS_OK)
> - return ret;
> + goto err_restore_env1;
>
> ret = setvariable_checkvariable(fw, datasize, varname,
> >estguid1, datadiff2);
> if (ret != FWTS_OK)
> goto err_restore_env2;
>
> - ret = setvariable_insertvariable(fw, attributes, 0,
> - varname, >estguid1, datadiff2);
> - if (ret != FWTS_OK)
> - return ret;
> -
> datasize = 5;
>
> ret = setvariable_insertvariable(fw, attributes, datasize,
> varname, >estguid1, datadiff3);
> if (ret != FWTS_OK)
> - return ret;
> + goto err_restore_env2;
>
> ret = setvariable_checkvariable(fw, datasize, varname,
> >estguid1, datadiff3);
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list