diff options
author | Greg Kurz <groug@kaod.org> | 2018-04-09 12:15:10 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-04-30 10:31:41 +0200 |
commit | c96f2c2a165acf92ff987ebc9e225452250c5083 (patch) | |
tree | ab679237440e503871600ab2d306adf12d8d88e8 /hw/ppc/fdt.c | |
parent | 98e43b71b25330566d902fbdc8fe35041c2decbe (diff) | |
download | qemu-c96f2c2a165acf92ff987ebc9e225452250c5083.zip qemu-c96f2c2a165acf92ff987ebc9e225452250c5083.tar.gz qemu-c96f2c2a165acf92ff987ebc9e225452250c5083.tar.bz2 |
vfio-ccw: introduce vfio_ccw_get_device()
A recent patch fixed leaks of the dynamically allocated vcdev->vdev.name
field in vfio_ccw_realize(), but we now have three freeing sites for it.
This is unfortunate and seems to indicate something is wrong with its
life cycle.
The root issue is that vcdev->vdev.name is set before vfio_get_device()
is called, which theoretically prevents to call vfio_put_device() to
do the freeing. Well actually, we could call it anyway because
vfio_put_base_device() is a nop if the device isn't attached, but this
would be confusing.
This patch hence moves all the logic of attaching the device, including
the "already attached" check, to a separate vfio_ccw_get_device() function,
counterpart of vfio_put_device(). While here, vfio_put_device() is renamed
to vfio_ccw_put_device() for consistency.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <152326891065.266543.9487977590811413472.stgit@bahia.lan>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/ppc/fdt.c')
0 files changed, 0 insertions, 0 deletions