aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pc.h')
-rw-r--r--hw/pc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/pc.h b/hw/pc.h
index 09f63f044a..89b43eaa1f 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -21,7 +21,10 @@ static inline bool serial_isa_init(int index, CharDriverState *chr)
{
ISADevice *dev;
- dev = isa_create("isa-serial");
+ dev = isa_try_create("isa-serial");
+ if (!dev) {
+ return false;
+ }
qdev_prop_set_uint32(&dev->qdev, "index", index);
qdev_prop_set_chr(&dev->qdev, "chardev", chr);
if (qdev_init(&dev->qdev) < 0) {