[PATCH v3] iommu/amd: Relay __modify_irte_ga() error in modify_irte_ga()

Jinhui Guo posted 1 patch 1 week, 3 days ago
drivers/iommu/amd/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v3] iommu/amd: Relay __modify_irte_ga() error in modify_irte_ga()
Posted by Jinhui Guo 1 week, 3 days ago
The return type of __modify_irte_ga() is int, but modify_irte_ga()
treats it as a bool. Casting the int to bool discards the error code.

To fix the issue, change the type of ret to int in modify_irte_ga().

Fixes: 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")
Cc: stable@vger.kernel.org
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hede@amd.com>
---

v1: https://lore.kernel.org/all/20251120154725.435-1-guojinhui.liam@bytedance.com/
v2: https://lore.kernel.org/all/20251121052139.550-1-guojinhui.liam@bytedance.com/

Changelog in v1 -> v2 (suggested by Ankit Soni)
 - Trim subject line to the recommanded length
Changelog in v2 -> v3
 - Add Reviewed-by Vasant Hegde; no code changes

 drivers/iommu/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 2e1865daa1ce..a38304f1a8df 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3354,7 +3354,7 @@ static int __modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
 static int modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
 			  struct irte_ga *irte)
 {
-	bool ret;
+	int ret;
 
 	ret = __modify_irte_ga(iommu, devid, index, irte);
 	if (ret)
-- 
2.20.1