summaryrefslogtreecommitdiff
path: root/cmd/qfw.c
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2022-05-25 14:38:55 +0100
committerTom Rini <trini@konsulko.com>2022-06-06 18:01:21 -0400
commit24272ffd505be0597703032dbdd8ffdd7ef7a1a9 (patch)
treee80f1d1bc0927a4a12822b5d5889a5a39cad35f5 /cmd/qfw.c
parentb257c4e9064dc4c2b86d30cec5ece368ca981225 (diff)
downloadu-boot-24272ffd505be0597703032dbdd8ffdd7ef7a1a9.tar.gz
u-boot-24272ffd505be0597703032dbdd8ffdd7ef7a1a9.tar.bz2
u-boot-24272ffd505be0597703032dbdd8ffdd7ef7a1a9.zip
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 <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reported-by: Andrew Walbran <qwandor@google.com> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Diffstat (limited to 'cmd/qfw.c')
-rw-r--r--cmd/qfw.c10
1 files changed, 6 insertions, 4 deletions
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);