diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2013-11-14 17:31:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 19:32:19 -0500 |
commit | 01058e70767de7b846588ef651c4d66e862f6823 (patch) | |
tree | 2c31954d0edb541eaa72afe9cc4dcd54ab98326c /drivers/iommu | |
parent | 8f43123d170ad9a6760e424af5bde7569fdd8c12 (diff) |
iommu/arm-smmu: handle pgtable_page_ctor() fail
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/arm-smmu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 181c9ba929cd..2349d6272aef 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -1212,7 +1212,10 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd, | |||
1212 | 1212 | ||
1213 | arm_smmu_flush_pgtable(smmu, page_address(table), | 1213 | arm_smmu_flush_pgtable(smmu, page_address(table), |
1214 | ARM_SMMU_PTE_HWTABLE_SIZE); | 1214 | ARM_SMMU_PTE_HWTABLE_SIZE); |
1215 | pgtable_page_ctor(table); | 1215 | if (!pgtable_page_ctor(table)) { |
1216 | __free_page(table); | ||
1217 | return -ENOMEM; | ||
1218 | } | ||
1216 | pmd_populate(NULL, pmd, table); | 1219 | pmd_populate(NULL, pmd, table); |
1217 | arm_smmu_flush_pgtable(smmu, pmd, sizeof(*pmd)); | 1220 | arm_smmu_flush_pgtable(smmu, pmd, sizeof(*pmd)); |
1218 | } | 1221 | } |