On Thu, Sep 10, 2020 at 06:16:21PM +0100, Joao Martins wrote:
> After commit 26e495f34107 ("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.
>
> Cc: Suravee Suthikulpanit <[email protected]>
> Fixes: 26e495f34107 ("iommu/amd: Restore IRTE.RemapEn bit after programming
> IRTE")
> Reported-by: Dan Carpenter <[email protected]>
> Signed-off-by: Joao Martins <[email protected]>
> ---
> drivers/iommu/amd/iommu.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied for v5.9, thanks.