Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347914
b: refs/heads/master
c: 9a92c50
h: refs/heads/master
v: v3
  • Loading branch information
Alex Williamson committed Dec 7, 2012
1 parent fd965b9 commit 80959dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05bf3aac930752408bf38a3f070061fc5f1b9c73
refs/heads/master: 9a92c5091a42c565ede818fdf204c4f60004d0d8
23 changes: 10 additions & 13 deletions trunk/drivers/vfio/pci/vfio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev)
u16 cmd;
u8 msix_pos;

ret = pci_enable_device(pdev);
if (ret)
return ret;

vdev->reset_works = (pci_reset_function(pdev) == 0);
pci_save_state(pdev);
vdev->pci_saved_state = pci_store_saved_state(pdev);
Expand All @@ -51,8 +55,11 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev)
__func__, dev_name(&pdev->dev));

ret = vfio_config_init(vdev);
if (ret)
goto out;
if (ret) {
pci_load_and_free_saved_state(pdev, &vdev->pci_saved_state);
pci_disable_device(pdev);
return ret;
}

if (likely(!nointxmask))
vdev->pci_2_3 = pci_intx_mask_supported(pdev);
Expand All @@ -77,17 +84,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev)
} else
vdev->msix_bar = 0xFF;

ret = pci_enable_device(pdev);
if (ret)
goto out;

return ret;

out:
kfree(vdev->pci_saved_state);
vdev->pci_saved_state = NULL;
vfio_config_free(vdev);
return ret;
return 0;
}

static void vfio_pci_disable(struct vfio_pci_device *vdev)
Expand Down

0 comments on commit 80959dd

Please sign in to comment.