|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1 2/5] vpci: rework error path in vpci_process_pending()
This will make further refactoring simpler.
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
xen/drivers/vpci/header.c | 42 +++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index e42c8efa2302..c1463d2ce076 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -214,27 +214,7 @@ bool vpci_process_pending(struct vcpu *v)
}
if ( rc )
- {
- spin_lock(&pdev->vpci->lock);
- /* Disable memory decoding unconditionally on failure. */
- modify_decoding(pdev, v->vpci.cmd & ~PCI_COMMAND_MEMORY,
- false);
- spin_unlock(&pdev->vpci->lock);
-
- /* Clean all the rangesets */
- for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
- if ( !rangeset_is_empty(header->bars[i].mem) )
- rangeset_purge(header->bars[i].mem);
-
- v->vpci.pdev = NULL;
-
- read_unlock(&v->domain->pci_lock);
-
- if ( !is_hardware_domain(v->domain) )
- domain_crash(v->domain);
-
- return false;
- }
+ goto fail;
}
v->vpci.pdev = NULL;
@@ -245,6 +225,26 @@ bool vpci_process_pending(struct vcpu *v)
read_unlock(&v->domain->pci_lock);
return false;
+
+ fail:
+ spin_lock(&pdev->vpci->lock);
+ /* Disable memory decoding unconditionally on failure. */
+ modify_decoding(pdev, v->vpci.cmd & ~PCI_COMMAND_MEMORY, false);
+ spin_unlock(&pdev->vpci->lock);
+
+ /* Clean all the rangesets */
+ for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
+ if ( !rangeset_is_empty(header->bars[i].mem) )
+ rangeset_purge(header->bars[i].mem);
+
+ v->vpci.pdev = NULL;
+
+ read_unlock(&v->domain->pci_lock);
+
+ if ( !is_hardware_domain(v->domain) )
+ domain_crash(v->domain);
+
+ return false;
}
static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
--
2.49.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |