Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 367d04c4 authored by Jiri Slaby's avatar Jiri Slaby Committed by Joerg Roedel
Browse files

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: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent c1eee67b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1541,8 +1541,10 @@ static void *alloc_coherent(struct device *dev, size_t size,
	*dma_addr = __map_single(dev, iommu, domain->priv, paddr,
				 size, DMA_BIDIRECTIONAL, true, dma_mask);

	if (*dma_addr == bad_dma_address)
	if (*dma_addr == bad_dma_address) {
		spin_unlock_irqrestore(&domain->lock, flags);
		goto out_free;
	}

	iommu_completion_wait(iommu);