From: SeokYeon Hwang Date: Tue, 8 Jul 2014 08:37:44 +0000 (+0900) Subject: emulator: trivial changes X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ee44f37a59f8d2cc48c3b3c095bb910f23bc681;p=sdk%2Femulator%2Fqemu.git emulator: trivial changes Fix "Out-of-bounds read" at pcihp.c Fix error handling at shpc.c Signed-off-by: SeokYeon Hwang --- diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index f80c48008c..3351f83486 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -229,7 +229,7 @@ static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size) uint32_t val = 0; int bsel = s->hotplug_select; - if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) { + if (bsel < 0 || bsel >= ACPI_PCIHP_MAX_HOTPLUG_BUS) { return 0; } diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c index 180faa7adb..b01519bff6 100644 --- a/hw/pci/shpc.c +++ b/hw/pci/shpc.c @@ -559,8 +559,9 @@ void shpc_device_hot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, uint8_t led; int slot; - shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, errp); + shpc_device_hotplug_common(PCI_DEVICE(dev), &slot, shpc, &local_err); if (local_err) { + error_propagate(errp, local_err); return; }