Device-assignment: init_assigned_device() error handling
commitb529bc6d2238b4d3d80a1bfc8d728ca28b9b7d89
authorMark McLoughlin <markmc@redhat.com>
Fri, 28 Nov 2008 17:10:50 +0000 (28 17:10 +0000)
committerAvi Kivity <avi@redhat.com>
Sun, 30 Nov 2008 10:46:55 +0000 (30 12:46 +0200)
treed39bec35db3e48820eb449268d0bca7049d0e839
parentd8b899f5ba37ab520ee0ae924dc9604a3298821d
Device-assignment: init_assigned_device() error handling

Associate the AssignedDevice with the AssignedDevInfo as soon as
we have allocated it and don't try and free it in init_assigned_device()
if an error occurs.

This ensures that the mmio region is unmapped by free_assigned_device()
if init_assigned_device() fails.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/device-assignment.c