提交 6b04456e 编写于 作者: T Tanmay Bhushan 提交者: Michael S. Tsirkin

vdpa: ifcvf: Do proper cleanup if IFCVF init fails

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: NTanmay Bhushan <007047221b@gmail.com>
Message-Id: <772e9fe133f21fa78fb98a2ebe8969efbbd58e3c.camel@gmail.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Acked-by: NJason Wang <jasowang@redhat.com>
Acked-by: NZhu Lingshan <lingshan.zhu@intel.com>
上级 6dd88fd5
...@@ -849,7 +849,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -849,7 +849,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = ifcvf_init_hw(vf, pdev); ret = ifcvf_init_hw(vf, pdev);
if (ret) { if (ret) {
IFCVF_ERR(pdev, "Failed to init IFCVF hw\n"); IFCVF_ERR(pdev, "Failed to init IFCVF hw\n");
return ret; goto err;
} }
for (i = 0; i < vf->nr_vring; i++) for (i = 0; i < vf->nr_vring; i++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册