iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 27 Feb 2017 12:30:26 +0000 (14:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:07:19 +0000 (10:07 +0100)
commit3d40364d333e3de4cc2e49c80ad8ddb242c46315
tree2903741286b40f106b11e3ed2755923b436ded29
parent721c136ac2780e519cd44940ba47f08cdeafec9d
iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it

[ Upstream commit a03849e7210277fa212779b7cd9c30e1ab6194b2 ]

Do a check for already installed leaf entry at the current level before
dereferencing it in order to avoid walking the page table down with
wrong pointer to the next level.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
CC: Will Deacon <will.deacon@arm.com>
CC: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/io-pgtable-arm-v7s.c