[PATCH 1/1] efi_loader: correct check in efi_load_option_dp_join()

Ilias Apalodimas ilias.apalodimas at linaro.org
Wed Jul 24 15:44:03 CEST 2024


On Wed, 24 Jul 2024 at 16:26, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> After assigning to *dp we must check this value and not dp.
>
> Addresses-Coverity-ID: 501792 Control flow issues (DEADCODE)
> Fixes: 58bef195f94e ("cmd: eficonfig: add support for setting fdt")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  lib/efi_loader/efi_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
> index 348612c3dad..65d2116381a 100644
> --- a/lib/efi_loader/efi_helper.c
> +++ b/lib/efi_loader/efi_helper.c
> @@ -133,7 +133,7 @@ efi_status_t efi_load_option_dp_join(struct efi_device_path **dp,
>
>                 *dp = efi_dp_concat(tmp_dp, fdt_dp, *dp_size);
>                 efi_free_pool(tmp_dp);
> -               if (!dp)
> +               if (!*dp)
>                         return EFI_OUT_OF_RESOURCES;
>                 *dp_size += efi_dp_size(fdt_dp) + sizeof(END);
>         }
> --
> 2.45.2
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>


More information about the U-Boot mailing list