aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-04 10:20:16 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:53:41 -0400
commit0e1e367aab873becf3e21d9b0cf46d11154ebc3f (patch)
treeb7a5e766ed9325dca8c0e62708fb082c7d10107a /drivers/pci
parentbc5fdf9f3aad37406b3c8d635a7940cd65de0c12 (diff)
pci: intr-remap: Free irte memory if SPARSE_IRQ=y
With SPARSE_IRQ=y the irte descriptors are dynamically allocated, but not freed in free_irte(). That was ok as long as the sparse irq core was not freeing irq descriptors on destroy_irq(). Now we leak the irte descriptor. Free it in free_irte(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/intr_remapping.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index fd1d2867cdcc..87ec390e10df 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -95,6 +95,15 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
95 return desc->irq_2_iommu; 95 return desc->irq_2_iommu;
96} 96}
97 97
98static void irq_2_iommu_free(unsigned int irq)
99{
100 struct irq_data *d = irq_get_irq_data(irq);
101 struct irq_2_iommu *p = d->irq_2_iommu;
102
103 d->irq_2_iommu = NULL;
104 kfree(p);
105}
106
98#else /* !CONFIG_SPARSE_IRQ */ 107#else /* !CONFIG_SPARSE_IRQ */
99 108
100static struct irq_2_iommu irq_2_iommuX[NR_IRQS]; 109static struct irq_2_iommu irq_2_iommuX[NR_IRQS];
@@ -110,6 +119,9 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
110{ 119{
111 return irq_2_iommu(irq); 120 return irq_2_iommu(irq);
112} 121}
122
123static void irq_2_iommu_free(unsigned int irq) { }
124
113#endif 125#endif
114 126
115static DEFINE_SPINLOCK(irq_2_ir_lock); 127static DEFINE_SPINLOCK(irq_2_ir_lock);
@@ -440,6 +452,8 @@ int free_irte(int irq)
440 452
441 spin_unlock_irqrestore(&irq_2_ir_lock, flags); 453 spin_unlock_irqrestore(&irq_2_ir_lock, flags);
442 454
455 irq_2_iommu_free(irq);
456
443 return rc; 457 return rc;
444} 458}
445 459