Patchwork [v2,2/2] hw/i386/pc: check a20_out in port92_realizefn

login
register
mail settings
Submitter liguang
Date March 28, 2013, 9:03 a.m.
Message ID <1364461382-20359-2-git-send-email-lig.fnst@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/231956/
State New
Headers show

Comments

liguang - March 28, 2013, 9:03 a.m.
as suggested by Andreas

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 hw/i386/pc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b881314..b0454eb 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -503,6 +503,11 @@  static void port92_realizefn(DeviceState *dev, Error **err)
     ISADevice *isadev = ISA_DEVICE(dev);
     Port92State *s = PORT92(dev);
 
+    if (s->a20_out == NULL) {
+        error_setg(err, "Can't create port92 device.\n");
+        return;
+    }
+
     memory_region_init_io(&s->io, &port92_ops, s, "port92", 1);
     isa_register_ioport(isadev, &s->io, 0x92);