]> xenbits.xensource.com Git - qemu-xen-4.3-testing.git/commit
qemu-xen: fix sequence of operations in pt_msix_init()
authorJan Beulich <jbeulich@suse.com>
Thu, 5 Jan 2012 17:15:46 +0000 (17:15 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 5 Jan 2012 17:15:46 +0000 (17:15 +0000)
commit4181a6d8c38bb86b1d8c3ef1b41831bee03424dd
tree50b645725b972ca660e805516badd17cde2ba605
parent56d7747a3cf811910c4cf865e1ebcb8b82502005
qemu-xen: fix sequence of operations in pt_msix_init()

Checking the return value of mmap() must be done before adjusting the
value, otherwise failure may not be detected.

Closing the file handle, on the other hand, can be done before checking
the return value.

Finally, printing the errno value without knowing whether the previous
function actually failed is bogus (and superfluous since a subsequent
message prints the strerror() representaton anyway).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/pt-msi.c