iommu/vt-d: Fix mm reference leak
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Fri, 20 Mar 2020 04:32:30 +0000 (21:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Apr 2020 06:01:21 +0000 (08:01 +0200)
commitc49f66238e53f4b9f208ef6bf879b2688e28d6f7
tree61ad47bb53e9d8643d5943efd6b83c7aa4efe357
parentaf8a66de65efe29be42f0726f477fff2e7bc1560
iommu/vt-d: Fix mm reference leak

[ Upstream commit 902baf61adf6b187f0a6b789e70d788ea71ff5bc ]

Move canonical address check before mmget_not_zero() to avoid mm
reference leak.

Fixes: 9d8c3af31607 ("iommu/vt-d: IOMMU Page Request needs to check if address is canonical.")
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel-svm.c