summary refs log tree commit diff stats
path: root/hw/ide/core.c
diff options
context:
space:
mode:
authorDon Slutz <dslutz@verizon.com>2014-11-17 16:20:39 -0500
committerPeter Maydell <peter.maydell@linaro.org>2014-11-18 17:36:14 +0000
commit6b896ab261942f441a16836e3fa3c83f3f4488b9 (patch)
treeae5646195c73af052e6868467eb32f562539b823 /hw/ide/core.c
parent8336e465acdc0ebaaaa685d218edca346f91100b (diff)
downloadfocaccia-qemu-6b896ab261942f441a16836e3fa3c83f3f4488b9.tar.gz
focaccia-qemu-6b896ab261942f441a16836e3fa3c83f3f4488b9.zip
hw/ide/core.c: Prevent SIGSEGV during migration
The other callers to blk_set_enable_write_cache() in this file
already check for s->blk == NULL.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1416259239-13281-1-git-send-email-dslutz@verizon.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r--hw/ide/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 00e21cf7ef..d4af5e2eb1 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2401,7 +2401,7 @@ static int ide_drive_post_load(void *opaque, int version_id)
 {
     IDEState *s = opaque;
 
-    if (s->identify_set) {
+    if (s->blk && s->identify_set) {
         blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5)));
     }
     return 0;