ahci: Reorder error cases in handle_cmd
commit36ab3c3400ac941e4d9afc044be08143ff9eea62
authorJohn Snow <jsnow@redhat.com>
Mon, 3 Nov 2014 23:56:17 +0000 (3 18:56 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 14 Nov 2014 09:20:35 +0000 (14 09:20 +0000)
tree12e10693d3a59a24463cc157e075495dcca684d9
parent1cbdd96813474de4191b0b37b859a5460373093b
ahci: Reorder error cases in handle_cmd

Error checking in ahci's handle_cmd is re-ordered so that we
initialize as few things as possible before we've done our
sanity checking. This simplifies returning from this call
in case of an error.

A check to make sure the DMA memory map succeeds with the
correct size is also added, and the debug print of the
command fis is cleaned up with its size corrected.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1415058979-16604-4-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/ide/ahci.c