mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
iommu/vt-d: Enhance error recovery in function intel_enable_irq_remapping()
Enhance error recovery in function intel_enable_irq_remapping() by tearing down all created data structures. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
This commit is contained in:
parent
a7a3dad944
commit
51acce33c4
1 changed files with 5 additions and 3 deletions
|
|
@ -702,9 +702,11 @@ static int __init intel_enable_irq_remapping(void)
|
|||
return eim ? IRQ_REMAP_X2APIC_MODE : IRQ_REMAP_XAPIC_MODE;
|
||||
|
||||
error:
|
||||
/*
|
||||
* handle error condition gracefully here!
|
||||
*/
|
||||
for_each_iommu(iommu, drhd)
|
||||
if (ecap_ir_support(iommu->ecap)) {
|
||||
iommu_disable_irq_remapping(iommu);
|
||||
intel_teardown_irq_remapping(iommu);
|
||||
}
|
||||
|
||||
if (x2apic_present)
|
||||
pr_warn("Failed to enable irq remapping. You are vulnerable to irq-injection attacks.\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue