Commit cce64861 authored by Prasad J Pandit's avatar Prasad J Pandit Committed by Marcel Apfelbaum
Browse files

pvrdma: release device resources in case of an error



If during pvrdma device initialisation an error occurs,
pvrdma_realize() does not release memory resources, leading
to memory leakage.

Reported-by: default avatarLi Qiang <liq3ea@163.com>
Signed-off-by: default avatarPrasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20181212175817.815-1-ppandit@redhat.com>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
parent 46b69a88
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ static void pvrdma_shutdown_notifier(Notifier *n, void *opaque)

static void pvrdma_realize(PCIDevice *pdev, Error **errp)
{
    int rc;
    int rc = 0;
    PVRDMADev *dev = PVRDMA_DEV(pdev);
    Object *memdev_root;
    bool ram_shared = false;
@@ -649,6 +649,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp)

out:
    if (rc) {
        pvrdma_fini(pdev);
        error_append_hint(errp, "Device fail to load\n");
    }
}