summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell2021-03-17 16:01:09 +0100
committerPeter Maydell2021-03-17 16:01:09 +0100
commit569a9481034b43f650dbb82dd7820beb0051508e (patch)
tree9fda2cbc5c365b189702dccd43e2a28097fba466 /hw
parentMerge remote-tracking branch 'remotes/kraxel/tags/ui-20210316-pull-request' i... (diff)
parents390x/pci: Add missing initialization for g_autofree variables (diff)
downloadqemu-569a9481034b43f650dbb82dd7820beb0051508e.tar.gz
qemu-569a9481034b43f650dbb82dd7820beb0051508e.tar.xz
qemu-569a9481034b43f650dbb82dd7820beb0051508e.zip
Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210316' into staging
s390x updates: - get rid of legacy_s390_alloc() and phys_mem_set_alloc() - tcg: implement the MVPG condition-code-option bit - fix g_autofree variable handing in the pci vfio code - use official z15 names in the cpu model definitions # gpg: Signature made Tue 16 Mar 2021 10:04:21 GMT # gpg: using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF # gpg: issuer "cohuck@redhat.com" # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown] # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full] # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full] # gpg: aka "Cornelia Huck <cohuck@kernel.org>" [unknown] # gpg: aka "Cornelia Huck <cohuck@redhat.com>" [unknown] # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck-gitlab/tags/s390x-20210316: s390x/pci: Add missing initialization for g_autofree variables target/s390x: Store r1/r2 for page-translation exceptions during MVPG target/s390x: Implement the MVPG condition-code-option bit s390x/cpu_model: use official name for 8562 exec: Get rid of phys_mem_set_alloc() s390x/kvm: Get rid of legacy_s390_alloc() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/s390x/s390-pci-vfio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
index ead4f222d5..2a153fa8c9 100644
--- a/hw/s390x/s390-pci-vfio.c
+++ b/hw/s390x/s390-pci-vfio.c
@@ -29,14 +29,11 @@
*/
bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
{
- g_autofree struct vfio_iommu_type1_info *info;
- uint32_t argsz;
+ uint32_t argsz = sizeof(struct vfio_iommu_type1_info);
+ g_autofree struct vfio_iommu_type1_info *info = g_malloc0(argsz);
assert(avail);
- argsz = sizeof(struct vfio_iommu_type1_info);
- info = g_malloc0(argsz);
-
/*
* If the specified argsz is not large enough to contain all capabilities
* it will be updated upon return from the ioctl. Retry until we have
@@ -230,7 +227,7 @@ static void s390_pci_read_pfip(S390PCIBusDevice *pbdev,
*/
void s390_pci_get_clp_info(S390PCIBusDevice *pbdev)
{
- g_autofree struct vfio_device_info *info;
+ g_autofree struct vfio_device_info *info = NULL;
VFIOPCIDevice *vfio_pci;
uint32_t argsz;
int fd;