• Russell King's avatar
    iommu/tegra-smmu: Fix iova_to_phys() method · 9113785c
    Russell King authored
    iova_to_phys() has several problems:
    (a) iova_to_phys() is supposed to return 0 if there is no entry present
        for the iova.
    (b) if as_get_pte() fails, we oops the kernel by dereferencing a NULL
        pointer.  Really, we should not even be trying to allocate a page
        table at all, but should only be returning the presence of the 2nd
        level page table.  This will be fixed in a subsequent patch.
    
    Treat both of these conditions as "no mapping" conditions.
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    9113785c
tegra-smmu.c 19.6 KB