summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authoryzhai003@ucr.edu <yzhai003@ucr.edu>2018-06-01 20:30:14 +0200
committerJoerg Roedel <jroedel@suse.de>2018-07-06 13:18:11 +0200
commit4674686d6c8974eb4eebec894c398a0f6c506af3 (patch)
tree25a42871978b6d3e4494901f5de8a3ad9484e9f6 /drivers/iommu
parentLinux 4.18-rc3 (diff)
downloadlinux-4674686d6c8974eb4eebec894c398a0f6c506af3.tar.xz
linux-4674686d6c8974eb4eebec894c398a0f6c506af3.zip
iommu/amd: Argument page_size could be uninitialized
Argument "page_size" passing to function "fetch_pte" could be uninitialized if the function returns NULL The caller "iommu_unmap_page" checks the return value but the page_size is used outside the if block. Signed-off-by: yzhai003@ucr.edu <yzhai003@ucr.edu> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 596b95c50051..e688169721b8 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1404,6 +1404,8 @@ static u64 *fetch_pte(struct protection_domain *domain,
int level;
u64 *pte;
+ *page_size = 0;
+
if (address > PM_LEVEL_SIZE(domain->mode))
return NULL;