]> www.infradead.org Git - users/dwmw2/qemu.git/commit
vfio/pci: Use g_autofree in vfio_realize
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 7 May 2024 06:42:42 +0000 (14:42 +0800)
committerCédric Le Goater <clg@redhat.com>
Thu, 16 May 2024 14:59:20 +0000 (16:59 +0200)
commit81987bd58b558be71dc4d8adf163f8c787a1c3e9
treecd87bf9d892a49a0aefd6725dbcf9c03689b33c4
parent11ebce2a5544cacab31e8ff169c6f0ceef37f4e8
vfio/pci: Use g_autofree in vfio_realize

Local pointer name is allocated before vfio_attach_device() call
and freed after the call.

Same for tmp when calling realpath().

Use 'g_autofree' to avoid the g_free() calls.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/pci.c