linux/drivers/iommu/amd
Joao Martins 14c4acc5ed iommu/amd: Fix potential @entry null deref
After commit 26e495f341 ("iommu/amd: Restore IRTE.RemapEn bit after
programming IRTE"), smatch warns:

	drivers/iommu/amd/iommu.c:3870 amd_iommu_deactivate_guest_mode()
        warn: variable dereferenced before check 'entry' (see line 3867)

Fix this by moving the @valid assignment to after @entry has been checked
for NULL.

Fixes: 26e495f341 ("iommu/amd: Restore IRTE.RemapEn bit after programming IRTE")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20200910171621.12879-1-joao.m.martins@oracle.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2020-09-18 10:35:11 +02:00
..
amd_iommu_types.h
amd_iommu.h iommu/amd: Make amd_iommu_apply_ivrs_quirks() static inline 2020-06-30 14:47:42 +02:00
debugfs.c
init.c iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE 2020-09-04 11:53:18 +02:00
iommu_v2.c iommu/amd: Do not use IOMMUv2 functionality when SME is active 2020-09-04 12:07:08 +02:00
iommu.c iommu/amd: Fix potential @entry null deref 2020-09-18 10:35:11 +02:00
Kconfig iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE 2020-09-04 11:53:18 +02:00
Makefile iommu/amd: Move Kconfig and Makefile bits down into amd directory 2020-07-29 14:15:36 +02:00
quirks.c