From: Pierre-Clément Tosi Date: Wed, 25 May 2022 13:38:55 +0000 (+0100) Subject: qfw: Don't fail if setup data size is 0 X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=24272ffd505be0597703032dbdd8ffdd7ef7a1a9;p=u-boot.git qfw: Don't fail if setup data size is 0 Skip missing setup data (which is valid) rather than failing with an error. Cc: Bin Meng Cc: Simon Glass Reported-by: Andrew Walbran Signed-off-by: Pierre-Clément Tosi --- diff --git a/cmd/qfw.c b/cmd/qfw.c index d58615040c..ccbc967ca9 100644 --- a/cmd/qfw.c +++ b/cmd/qfw.c @@ -25,15 +25,17 @@ static int qemu_fwcfg_cmd_setup_kernel(void *load_addr, void *initrd_addr) qfw_read_entry(qfw_dev, FW_CFG_SETUP_SIZE, 4, &setup_size); qfw_read_entry(qfw_dev, FW_CFG_KERNEL_SIZE, 4, &kernel_size); - if (setup_size == 0 || kernel_size == 0) { + if (kernel_size == 0) { printf("warning: no kernel available\n"); return -1; } data_addr = load_addr; - qfw_read_entry(qfw_dev, FW_CFG_SETUP_DATA, - le32_to_cpu(setup_size), data_addr); - data_addr += le32_to_cpu(setup_size); + if (setup_size != 0) { + qfw_read_entry(qfw_dev, FW_CFG_SETUP_DATA, + le32_to_cpu(setup_size), data_addr); + data_addr += le32_to_cpu(setup_size); + } qfw_read_entry(qfw_dev, FW_CFG_KERNEL_DATA, le32_to_cpu(kernel_size), data_addr);