projects/linux·commit 6b04456e

vdpa: ifcvf: Do proper cleanup if IFCVF init fails

6b04456e · Tanmay Bhushan <[email protected]> · 2022-12-27 22:02:16 +01:00

ifcvf_mgmt_dev leaks memory if it is not freed before
returning. Call is made to correct return statement
so memory does not leak. ifcvf_init_hw does not take
care of this so it is needed to do it here.

Signed-off-by: Tanmay Bhushan <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
Acked-by: Zhu Lingshan <[email protected]>
Commit
6b04456e248761cf68f562f2fd7c04e591fcac94
Parents
6dd88fd5

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/vdpa/ifcvf/ifcvf_main.cmodified+1−1View file

drivers/vdpa/ifcvf/ifcvf_main.c

View file
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index f9c0044..44b2928 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -849,7 +849,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = ifcvf_init_hw(vf, pdev);
if (ret) {
IFCVF_ERR(pdev, "Failed to init IFCVF hw\n");
- return ret;
+ goto err;
}
for (i = 0; i < vf->nr_vring; i++)