Skip to content

Commit c1b9f2c

Browse files
tititiou36mstsirkin
authored andcommitted
vdpa: Fix an error handling path in eni_vdpa_probe()
After a successful vp_legacy_probe() call, vp_legacy_remove() should be called in the error handling path, as already done in the remove function. Add the missing call. Fixes: e85087b ("eni_vdpa: add vDPA driver for Alibaba ENI") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Message-Id: <a7b0ef1eabd081f1c7c894e9b11de01678e85dee.1666293559.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent b8e0792 commit c1b9f2c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/vdpa/alibaba/eni_vdpa.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
497497
if (!eni_vdpa->vring) {
498498
ret = -ENOMEM;
499499
ENI_ERR(pdev, "failed to allocate virtqueues\n");
500-
goto err;
500+
goto err_remove_vp_legacy;
501501
}
502502

503503
for (i = 0; i < eni_vdpa->queues; i++) {
@@ -509,11 +509,13 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
509509
ret = vdpa_register_device(&eni_vdpa->vdpa, eni_vdpa->queues);
510510
if (ret) {
511511
ENI_ERR(pdev, "failed to register to vdpa bus\n");
512-
goto err;
512+
goto err_remove_vp_legacy;
513513
}
514514

515515
return 0;
516516

517+
err_remove_vp_legacy:
518+
vp_legacy_remove(&eni_vdpa->ldev);
517519
err:
518520
put_device(&eni_vdpa->vdpa.dev);
519521
return ret;

0 commit comments

Comments
 (0)