From: Heinrich Schuchardt Date: Fri, 24 May 2019 16:45:14 +0200 Subject: [U-Boot] [PATCH v2 2/3] efi_loader: variable: return error for APPEND_WRITE In-Reply-To: <20190524065903.21433-3-takahiro.akashi@linaro.org> References: <20190524065903.21433-1-takahiro.akashi@linaro.org> <20190524065903.21433-3-takahiro.akashi@linaro.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 5/24/19 8:59 AM, AKASHI Takahiro wrote: > The current efi_et_variable() doesn't support EFI_VARIABLE_APPEND_WRITE > attiribut for now, and so should return an error. > > Signed-off-by: AKASHI Takahiro I will correct the typos in the commit message and add a TODO comment in the code. Reviewed-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_variable.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c > index 28b1aa7505ae..e3ec502ffb45 100644 > --- a/lib/efi_loader/efi_variable.c > +++ b/lib/efi_loader/efi_variable.c > @@ -427,7 +427,8 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, > EFI_ENTRY("\"%ls\" %pUl %x %zu %p", variable_name, vendor, attributes, > data_size, data); > > - if (!variable_name || !vendor) { > + if (!variable_name || !vendor || > + (attributes & EFI_VARIABLE_APPEND_WRITE)) { > ret = EFI_INVALID_PARAMETER; > goto out; > } >