Skip to contentSkip to conversation

iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()

PATCH Applied Jinhui Guo 4 participants 4 messages Nov 20, 2025 – Nov 25, 2025

Subsystems (3)
lore
Share & tools
lore

Jinhui Guo

author
#0 lore raw

PATCH 1/1 iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()

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")
---
 drivers/iommu/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd/iommu.c +1 -1
index 2e1865daa1ce..a38304f1a8df 100644
@@ -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)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines · Jinhui Guo

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")

---

Hi,
Thanks for the patch. The subject line exceeds the recommended length. can you please resend patch with concise subject line.

Quoted 18 lines
 drivers/iommu/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd/iommu.c +1 -1
index 2e1865daa1ce..a38304f1a8df 100644
@@ -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)
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Jinhui Guo
Quoted 8 lines · Jinhui Guo

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")

-Vasant

maintainer Applied
#3 lore raw
In reply to Jinhui Guo
Quoted 11 lines · Jinhui Guo

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")
---
 drivers/iommu/amd/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.