aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-05-28 03:54:48 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-06-03 04:34:55 -0400
commit367d04c4ec02dad34d80452e32e3370db7fb6fee (patch)
treec6be71774b788662618c45470fc02b85e1797e26 /arch/x86/kernel/amd_iommu.c
parentc1eee67b2d8464781f5868a34168df61e40e85a6 (diff)
amd_iommu: fix lock imbalance
In alloc_coherent there is an omitted unlock on the path where mapping fails. Add the unlock. [ Impact: fix lock imbalance in alloc_coherent ] Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu.c')
-rw-r--r--arch/x86/kernel/amd_iommu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index d6898833c363..9f89bb645b31 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1541,8 +1541,10 @@ static void *alloc_coherent(struct device *dev, size_t size,
1541 *dma_addr = __map_single(dev, iommu, domain->priv, paddr, 1541 *dma_addr = __map_single(dev, iommu, domain->priv, paddr,
1542 size, DMA_BIDIRECTIONAL, true, dma_mask); 1542 size, DMA_BIDIRECTIONAL, true, dma_mask);
1543 1543
1544 if (*dma_addr == bad_dma_address) 1544 if (*dma_addr == bad_dma_address) {
1545 spin_unlock_irqrestore(&domain->lock, flags);
1545 goto out_free; 1546 goto out_free;
1547 }
1546 1548
1547 iommu_completion_wait(iommu); 1549 iommu_completion_wait(iommu);
1548 1550