Message ID | 20240316093644.54869-4-heinrich.schuchardt@canonical.com |
---|---|
State | Accepted, archived |
Commit | 68fc0b877b5ddc93eb542ffa26dcf83e7e2860a8 |
Delegated to: | Heinrich Schuchardt |
Headers | show |
Series | cmd: bootefi: fix error handling | expand |
On Sat, 16 Mar 2024 at 11:37, Heinrich Schuchardt <heinrich.schuchardt@canonical.com> wrote: > > If bootefi selftest is executed and a problem with the device-tree > installation occurs, efi_install_fdt() writes sensible error messages. > It never returns EFI_INVALID_PARAMETER. It neither makes sense to check > for EFI_INVALID_PARAMETER nor to show the usage help for the bootefi > command in this case. > > Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> > --- > cmd/bootefi.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/cmd/bootefi.c b/cmd/bootefi.c > index b509440cde0..578dbb19a7e 100644 > --- a/cmd/bootefi.c > +++ b/cmd/bootefi.c > @@ -171,9 +171,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, > } > > ret = efi_install_fdt(fdt); > - if (ret == EFI_INVALID_PARAMETER) > - return CMD_RET_USAGE; > - else if (ret != EFI_SUCCESS) > + if (ret != EFI_SUCCESS) > return CMD_RET_FAILURE; > > return do_efi_selftest(); > -- > 2.43.0 > Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff --git a/cmd/bootefi.c b/cmd/bootefi.c index b509440cde0..578dbb19a7e 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -171,9 +171,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, } ret = efi_install_fdt(fdt); - if (ret == EFI_INVALID_PARAMETER) - return CMD_RET_USAGE; - else if (ret != EFI_SUCCESS) + if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; return do_efi_selftest();
If bootefi selftest is executed and a problem with the device-tree installation occurs, efi_install_fdt() writes sensible error messages. It never returns EFI_INVALID_PARAMETER. It neither makes sense to check for EFI_INVALID_PARAMETER nor to show the usage help for the bootefi command in this case. Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> --- cmd/bootefi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)