[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH] isa-fdc: assert replaced by proper error exit
From: |
Eduardo Otubo |
Subject: |
[Qemu-trivial] [PATCH] isa-fdc: assert replaced by proper error exit |
Date: |
Fri, 1 Sep 2017 13:07:06 +0200 |
When not available, isa-fdc falls into assert instead of proper error
exit. This patch fixes this behavior.
Signed-off-by: Eduardo Otubo <address@hidden>
---
hw/block/fdc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 401129073b..0b6def4e1d 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2699,11 +2699,15 @@ static void isabus_fdc_realize(DeviceState *dev, Error
**errp)
fdctrl->dma_chann = isa->dma;
if (fdctrl->dma_chann != -1) {
fdctrl->dma = isa_get_dma(isa_bus_from_device(isadev), isa->dma);
- assert(fdctrl->dma);
+ if (!fdctrl->dma) {
+ error_setg(errp, "isa-fdc not supported");
+ goto error;
+ }
}
qdev_set_legacy_instance_id(dev, isa->iobase, 2);
fdctrl_realize_common(dev, fdctrl, &err);
+error:
if (err != NULL) {
error_propagate(errp, err);
return;
--
2.13.5
- [Qemu-trivial] [PATCH] isa-fdc: assert replaced by proper error exit,
Eduardo Otubo <=