iommu/amd: Fix failure return from snp_lookup_rmpentry()
authorAshish Kalra <ashish.kalra@amd.com>
Mon, 5 Feb 2024 21:06:54 +0000 (21:06 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 7 Feb 2024 16:27:03 +0000 (17:27 +0100)
commit45ba5b3c0a02949a4da74ead6e11c43e9b88bdca
tree238f18ac6ad00f2d23d4cd83b82c3a7d3ac5a325
parent1c811d403afd73f04bde82b83b24c754011bd0e8
iommu/amd: Fix failure return from snp_lookup_rmpentry()

Commit

  f366a8dac1b8: ("iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown")

leads to the following Smatch static checker warning:

  drivers/iommu/amd/init.c:3820 iommu_page_make_shared() error: uninitialized symbol 'assigned'.

Fix it.

  [ bp: Address the other error cases too. ]

Fixes: f366a8dac1b8 ("iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown")
Closes: https://lore.kernel.org/linux-iommu/1be69f6a-e7e1-45f9-9a74-b2550344f3fd@moroto.mountain
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Joerg Roedel <jroedel@suse.com>
Link: https://lore.kernel.org/lkml/20240126041126.1927228-20-michael.roth@amd.com
drivers/iommu/amd/init.c