Commit 0fbddcec authored by Markus Armbruster's avatar Markus Armbruster
Browse files

arm/virt: Fix virt_machine_device_plug_cb() error API violation



The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

virt_machine_device_plug_cb() passes @errp to
cryptodev_builtin_sym_close_session() in a loop.  Harmless, because
cryptodev_builtin_sym_close_session() can't actually fail.  Fix by
dropping its Error ** parameter.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200422130719.28225-6-armbru@redhat.com>
parent 9ec374a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1186,7 +1186,7 @@ static void create_smmu(const VirtMachineState *vms,
    g_free(node);
}

static void create_virtio_iommu_dt_bindings(VirtMachineState *vms, Error **errp)
static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
{
    const char compat[] = "virtio,pci-iommu";
    uint16_t bdf = vms->virtio_iommu_bdf;
@@ -2118,7 +2118,7 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,

        vms->iommu = VIRT_IOMMU_VIRTIO;
        vms->virtio_iommu_bdf = pci_get_bdf(pdev);
        create_virtio_iommu_dt_bindings(vms, errp);
        create_virtio_iommu_dt_bindings(vms);
    }
}