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

Commit 6da2b3fa authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: dma_mapping: dma-mapping: Fix leak of dma_iommu_mapping"

parents de364d84 1dbd83f3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2497,10 +2497,8 @@ static int arm_iommu_init_mapping(struct device *dev,
	u64 size = mapping->bits << PAGE_SHIFT;
	int is_fast = 0;

	if (mapping->init) {
		kref_get(&mapping->kref);
	if (mapping->init)
		return 0;
	}

	/* currently only 32-bit DMA address space is supported */
	if (size > DMA_BIT_MASK(32) + 1) {
+1 −3
Original line number Diff line number Diff line
@@ -2095,10 +2095,8 @@ static int arm_iommu_init_mapping(struct device *dev,
	int s1_bypass = 0, is_fast = 0, is_bitmap = 0;
	dma_addr_t iova_end;

	if (mapping->init) {
		kref_get(&mapping->kref);
	if (mapping->init)
		return 0;
	}

	iova_end = mapping->base + (mapping->bits << PAGE_SHIFT) - 1;
	if (iova_end > dma_get_mask(dev)) {