]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: eficonfig: check initrd path allocation
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 17 Apr 2024 16:01:25 +0000 (18:01 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 20 Apr 2024 06:21:28 +0000 (08:21 +0200)
After allocating memory for the initrd file path we need to check the
initrd buffer pointer is not NULL.

Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
cmd/eficonfig.c

index 8234e602b8fbe1384a03a1cb832ad7d13426af3a..0ba92c60e0392215f37a0981a4aeea24c78e1e98 100644 (file)
@@ -1419,7 +1419,7 @@ static efi_status_t eficonfig_edit_boot_option(u16 *varname, struct eficonfig_bo
        }
 
        bo->initrd_info.current_path = calloc(1, EFICONFIG_FILE_PATH_BUF_SIZE);
-       if (!bo->file_info.current_path) {
+       if (!bo->initrd_info.current_path) {
                ret =  EFI_OUT_OF_RESOURCES;
                goto out;
        }