Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hw/core/generic-loader: Fix crash when running without CPU
When running QEMU with "-M none -device loader,file=kernel.elf", it currently crashes with a segmentation fault, because the "none"-machine does not have any CPU by default and the generic loader code tries to dereference s->cpu. Fix it by adding an appropriate check for a NULL pointer. Reported-by: Laurent Vivier <[email protected]> Signed-off-by: Thomas Huth <[email protected]> Reviewed-by: Laurent Vivier <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Signed-off-by: Michael Tokarev <[email protected]>
- Loading branch information