mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-28 20:41:52 -06:00
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>
This commit is contained in:
parent
8336e465ac
commit
6b896ab261
1 changed files with 1 additions and 1 deletions
|
@ -2401,7 +2401,7 @@ static int ide_drive_post_load(void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
IDEState *s = opaque;
|
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)));
|
blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5)));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue