]> git.ipfire.org Git - thirdparty/qemu.git/commit
Allow setting up to 8 bytes with the generic loader
authorPetr Tesarik <ptesarik@suse.com>
Thu, 20 Jan 2022 09:27:15 +0000 (10:27 +0100)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 16 Feb 2022 02:24:18 +0000 (12:24 +1000)
commitf42483d776bce29a9925ed61cc10eb27a5b2446c
tree2a5b12a80aa14032be220a5e3c8f2bf753c3fcc4
parenta6b7bd35f307bafb1f05d248194ae976e29949c8
Allow setting up to 8 bytes with the generic loader

The documentation for the generic loader says that "the maximum size of
the data is 8 bytes". However, attempts to set data-len=8 trigger the
following assertion failure:

../hw/core/generic-loader.c:59: generic_loader_reset: Assertion `s->data_len < sizeof(s->data)' failed.

The type of s->data is uint64_t (i.e. 8 bytes long), so I believe this
assert should use <= instead of <.

Fixes: e481a1f63c93 ("generic-loader: Add a generic loader")
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20220120092715.7805-1-ptesarik@suse.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/core/generic-loader.c