Skip to content

Commit

Permalink
iommu/arm-smmu: remove potential NULL dereference on mapping path
Browse files Browse the repository at this point in the history
When handling mapping requests, we dereference the SMMU domain before
checking that it is NULL. This patch fixes the issue by removing the check
altogether, since we don't actually use the leaf_smmu when creating
mappings.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Will Deacon committed Dec 6, 2013
1 parent a44a979 commit 5552ecd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/iommu/arm-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,8 @@ static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova,
phys_addr_t paddr, size_t size, int flags)
{
struct arm_smmu_domain *smmu_domain = domain->priv;
struct arm_smmu_device *smmu = smmu_domain->leaf_smmu;

if (!smmu_domain || !smmu)
if (!smmu_domain)
return -ENODEV;

/* Check for silent address truncation up the SMMU chain. */
Expand Down

0 comments on commit 5552ecd

Please sign in to comment.