Our efi_var_mem_xxx() functions don't have a replace variant. Instead we
add a new variable and delete the old instance when trying to replace a
variable. Currently we delete the old version without checking the new
one got added
Signed-off-by: Ilias Apalodimas <apalos@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
ret = efi_var_mem_ins(variable_name, vendor, attributes,
data_size, data, 0, NULL, time);
}
- efi_var_mem_del(var);
if (ret != EFI_SUCCESS)
return ret;
+ efi_var_mem_del(var);
+
if (var_type == EFI_AUTH_VAR_PK)
ret = efi_init_secure_state();
else