Skip to content

Commit

Permalink
iommu/arm-smmu: Return 0 on unmap failure
Browse files Browse the repository at this point in the history
The IOMMU core expects the unmap operation to return the number of bytes
that have been unmapped or 0 on failure, a negative return value being
treated like a number of bytes.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Laurent Pinchart authored and Will Deacon committed Apr 15, 2014
1 parent c9eaa44 commit 16c50dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/arm-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ static size_t arm_smmu_unmap(struct iommu_domain *domain, unsigned long iova,

ret = arm_smmu_handle_mapping(smmu_domain, iova, 0, size, 0);
arm_smmu_tlb_inv_context(&smmu_domain->root_cfg);
return ret ? ret : size;
return ret ? 0 : size;
}

static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain,
Expand Down

0 comments on commit 16c50dc

Please sign in to comment.