summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorKevin Wolf2014-08-12 18:29:41 +0200
committerStefan Hajnoczi2014-08-15 19:03:13 +0200
commitf7f3ff1da0c451befc8d32f977f9c352d1303f40 (patch)
tree39f90c284a5603dfcd231a70b486119dc6b647db /hw
parentqemu-options: add missing -drive discard option to cmdline help (diff)
downloadqemu-f7f3ff1da0c451befc8d32f977f9c352d1303f40.tar.gz
qemu-f7f3ff1da0c451befc8d32f977f9c352d1303f40.tar.xz
qemu-f7f3ff1da0c451befc8d32f977f9c352d1303f40.zip
ide: Fix segfault when flushing a device that doesn't exist
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/ide/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index bdb0a804cf..82dd4afd84 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -848,7 +848,9 @@ static void ide_flush_cb(void *opaque, int ret)
}
}
- bdrv_acct_done(s->bs, &s->acct);
+ if (s->bs) {
+ bdrv_acct_done(s->bs, &s->acct);
+ }
s->status = READY_STAT | SEEK_STAT;
ide_cmd_done(s);
ide_set_irq(s->bus);