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

Commit 01058e70 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Linus Torvalds
Browse files

iommu/arm-smmu: handle pgtable_page_ctor() fail



Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8f43123d
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1212,7 +1212,10 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd,


		arm_smmu_flush_pgtable(smmu, page_address(table),
		arm_smmu_flush_pgtable(smmu, page_address(table),
				       ARM_SMMU_PTE_HWTABLE_SIZE);
				       ARM_SMMU_PTE_HWTABLE_SIZE);
		pgtable_page_ctor(table);
		if (!pgtable_page_ctor(table)) {
			__free_page(table);
			return -ENOMEM;
		}
		pmd_populate(NULL, pmd, table);
		pmd_populate(NULL, pmd, table);
		arm_smmu_flush_pgtable(smmu, pmd, sizeof(*pmd));
		arm_smmu_flush_pgtable(smmu, pmd, sizeof(*pmd));
	}
	}