OSDN Git Service

powerpc/iommu: Avoid derefence before pointer check
authorBreno Leitao <leitao@debian.org>
Tue, 21 Aug 2018 18:44:48 +0000 (15:44 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2019 13:43:36 +0000 (14:43 +0100)
commit3e3bf85c47a8be6961046f45457feca83b822127
tree43ae655d70d580fb860ad5d6fba67804a184cc1b
parent0955579c02fb5f3b7b3358903afa265373d713f9
powerpc/iommu: Avoid derefence before pointer check

[ Upstream commit 984ecdd68de0fa1f63ce205d6c19ef5a7bc67b40 ]

The tbl pointer is being derefenced by IOMMU_PAGE_SIZE prior the check
if it is not NULL.

Just moving the dereference code to after the check, where there will
be guarantee that 'tbl' will not be NULL.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/iommu.c