]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: correct check in efi_load_option_dp_join()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 24 Jul 2024 13:26:04 +0000 (15:26 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 31 Jul 2024 06:29:58 +0000 (08:29 +0200)
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@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_helper.c

index 348612c3dad1b7ab3e5a89d8d7eaf884eea627ec..65d2116381aee8fbf19a3a9a6169c56c5d524493 100644 (file)
@@ -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);
        }