summaryrefslogtreecommitdiff
path: root/hw/ide/ahci.h
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@xilinx.com>2015-09-08 17:38:45 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-09-08 17:38:45 +0100
commitbb639f829f139ddc83325b3b6825f93096ee44f1 (patch)
treec0a6568c3a1b746ff579367c7413f7d3bf23661a /hw/ide/ahci.h
parent5ea8b9c5a3e823d1446a7e67d6d3b8d86bfd33d8 (diff)
downloadqemu-bb639f829f139ddc83325b3b6825f93096ee44f1.tar.gz
ahci.c: Don't assume AHCIState's parent is AHCIPCIState
The AHCIState struct can either have AHCIPCIState or SysbusAHCIState as a parent. The ahci_irq_lower() and ahci_irq_raise() functions assume that it is always AHCIPCIState, which is not always the case, which causes a seg fault. Verify what the container of AHCIState is before setting the PCIDevice struct. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Acked-by: John Snow <jsnow@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ide/ahci.h')
-rw-r--r--hw/ide/ahci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h
index c055d6ba6b..c9b3805415 100644
--- a/hw/ide/ahci.h
+++ b/hw/ide/ahci.h
@@ -287,6 +287,8 @@ struct AHCIDevice {
};
typedef struct AHCIState {
+ DeviceState *container;
+
AHCIDevice *dev;
AHCIControlRegs control_regs;
MemoryRegion mem;