diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-06-22 11:42:26 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-06-23 16:07:07 +0200 |
commit | 17d26ac61ee637a38d58b7053fdd1695ea2b7bc9 (patch) | |
tree | b96e295179ed1ac2c551d3910b1631ce03c61c17 /hw/gpio/gpio_key.c | |
parent | c20b4ccce017bc6ac62617b458367f6a1de9afb5 (diff) | |
download | qemu-17d26ac61ee637a38d58b7053fdd1695ea2b7bc9.zip qemu-17d26ac61ee637a38d58b7053fdd1695ea2b7bc9.tar.gz qemu-17d26ac61ee637a38d58b7053fdd1695ea2b7bc9.tar.bz2 |
sd/pxa2xx_mmci: Don't crash on pxa2xx_mmci_init() error
On error, pxa2xx_mmci_init() reports to stderr and returns NULL.
Callers don't check for errors. Machines akita, borzoi, mainstone,
spitz, terrier, tosa, and z2 crash shortly after, like this:
$ qemu-system-aarch64 -M akita -drive if=sd,readonly=on
qemu-system-aarch64: failed to init SD card: Cannot use read-only drive as SD card
Segmentation fault (core dumped)
Machines connex and verdex reach the check for orphaned drives first:
$ aarch64-softmmu/qemu-system-aarch64 -M connex -drive if=sd,readonly=on -accel qtest
qemu-system-aarch64: failed to init SD card: Cannot use read-only drive as SD card
qemu-system-aarch64: -drive if=sd,readonly=on: machine type does not support if=sd,bus=0,unit=0
Make pxa2xx_mmci_init() fail cleanly right away.
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200622094227.1271650-16-armbru@redhat.com>
Diffstat (limited to 'hw/gpio/gpio_key.c')
0 files changed, 0 insertions, 0 deletions